/* ── AEGIS TABLET (768px – 1280px) ── */
@media (min-width: 768px) and (max-width: 1280px) {
  .aegis-stat-cards { grid-template-columns: 1fr !important; padding-left: 20px !important; }
  .aegis-charts { flex-direction: column !important; }
  .aegis-chart { width: 100% !important; min-width: 0 !important; }
  /* SMS-Schutz Card: visible on tablet */
  .aegis-sync-panel-sms {
    display: block !important;
  }
}

/* ── TABLET PORTRAIT ── */
@media (min-width: 768px) and (max-width: 1280px) and (min-height: 801px) {
  /* Sidebar versteckt wie Smartphone — Burger Menu */
  #aegis-sidebar#aegis-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: -280px !important;
    width: 280px !important;
    height: 100% !important;
    z-index: 10000 !important;
    transition: left 0.3s ease !important;
    flex-direction: column !important;
  }
  #aegis-sidebar#aegis-sidebar.mobile-open { left: 0 !important; }
  .aegis-burger { display: flex !important; }
  .aegis-nav-label { display: inline !important; }
  .aegis-license-quote.aegis-license-quote { left: -15px !important; }
  .aegis-license-key-container.aegis-license-key-container { left: -15px !important; }

  /* AEGIS Background-Text vertikal */
  #aegis-shield-container svg text {
    transform: rotate(90deg) !important;
    transform-origin: center !important;
    transform-box: fill-box !important;
    font-size: 300px !important;
  }

  /* Sync-Boxen 1-spaltig (nicht Email-Verbindungen) */
  .aegis-sync-row { grid-template-columns: 1fr !important; }

  #aegis-main#aegis-main { padding-left: 70px !important; }
  .aegis-welcome-title.aegis-welcome-title { margin-left: 50px !important; }
  .aegis-welcome-subtitle.aegis-welcome-subtitle { margin-left: 50px !important; }

  /* Email-Sidebar: gleich wie Hauptsidebar */
  .aegis-email-folders.aegis-email-folders {
    position: fixed !important;
    top: 0 !important;
    left: -280px !important;
    width: 280px !important;
    height: 100% !important;
    z-index: 10000 !important;
    transition: left 0.3s ease !important;
    flex-direction: column !important;
    overflow-y: auto !important;
    background: rgba(20,30,50,0.75) !important;
    backdrop-filter: blur(50px) !important;
    -webkit-backdrop-filter: blur(50px) !important;
    padding-top: 55px !important;
  }
  [data-theme="charcoal"] .aegis-email-folders.aegis-email-folders {
    background: rgb(44 46 51 / 75%) !important;
  }
  [data-theme="jade"] .aegis-email-folders.aegis-email-folders {
    background: rgb(20 50 38 / 75%) !important;
  }
  [data-theme="slate"] .aegis-email-folders.aegis-email-folders {
    background: rgb(44 46 51 / 75%) !important;
  }
  .aegis-folder-section-title.aegis-folder-section-title { margin-top: 30px !important; }
  .aegis-panel-title.aegis-panel-title { margin-top: 30px !important; }
  .aegis-compose-btn.aegis-compose-btn { margin-top: 30px !important; }
  .aegis-email-folders.aegis-email-folders.mobile-open { left: 0 !important; }

  /* Email-Liste volle Breite */
  .aegis-email-list-wrap, .aegis-email-list { width: 100% !important; }

  /* Header Banner: 1-spaltig unter Titel, voller Platz fuer Text */
  .aegis-panel-header.aegis-panel-header { flex-wrap: wrap !important; }
  .aegis-header-banner.aegis-header-banner {
    order: 3 !important;
    width: 100% !important;
    flex: 0 0 100% !important;
    text-align: center !important;
    font-size: 14px !important;
    margin-top: 12px !important;
    padding: 0 20px !important;
    line-height: 1.5 !important;
  }

  /* RTL (Arabic) - Tablet: Burger rechts */
  [dir="rtl"] .aegis-burger.aegis-burger {
    left: auto !important;
    right: -3px !important;
    -webkit-app-region: no-drag !important;
    cursor: pointer !important;
    z-index: 99999 !important;
    width: 52px !important;
    height: 52px !important;
  }
  [dir="rtl"] .aegis-burger-email.aegis-burger-email {
    left: auto !important;
    right: 2px !important;
  }

  /* RTL (Arabic) - Tablet: Sidebar von rechts */
  [dir="rtl"] #aegis-sidebar#aegis-sidebar {
    left: auto !important;
    right: -280px !important;
    transition: right 0.3s ease !important;
    border-right: none !important;
    border-left: 1px solid var(--aegis-glass-border) !important;
    padding-top: 54px !important;
  }
  [dir="rtl"] #aegis-sidebar#aegis-sidebar.mobile-open {
    left: auto !important;
    right: 0 !important;
  }

  /* RTL (Arabic) - Tablet: Overlay */
  [dir="rtl"] .aegis-mobile-overlay.active {
    left: auto !important;
    right: 0 !important;
  }

  /* RTL (Arabic) - Tablet: Email-Folders von rechts */
  [dir="rtl"] .aegis-email-folders.aegis-email-folders {
    left: auto !important;
    right: -280px !important;
    transition: right 0.3s ease !important;
    border-right: none !important;
    border-left: 1px solid var(--aegis-glass-border) !important;
  }
  [dir="rtl"] .aegis-email-folders.aegis-email-folders.mobile-open {
    left: auto !important;
    right: 0 !important;
  }

  /* RTL (Arabic) - Tablet: Panel Overlay */
  [dir="rtl"] #aegis-panel-overlay#aegis-panel-overlay {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    transform: translateX(-100%) !important;
  }
  [dir="rtl"] #aegis-panel-overlay#aegis-panel-overlay.open {
    transform: translateX(0) !important;
  }

  /* RTL (Arabic) - Tablet: Nav + Close */
  [dir="rtl"] #aegis-nav {
    margin-top: 40px !important;
  }
  [dir="rtl"] .aegis-panel-close.aegis-panel-close {
    right: auto !important;
    left: 12px !important;
  }

  /* RTL (Arabic) - Tablet: Compose Button Klickflaeche 30px links */
  [dir="rtl"] .aegis-compose-btn.aegis-compose-btn {
    padding-left: 30px !important;
    margin-left: -30px !important;
  }

  

  /* RTL (Arabic) - Tablet: Header Titel + Status 20px runter */
  [dir="rtl"] .aegis-header.aegis-header {
    margin-top: 20px !important;
    -webkit-app-region: no-drag !important;
  }
}

/* ── TABLET LANDSCAPE ── */
@media screen and (min-width: 769px) and (max-height: 800px) {
    /* FIX 2026-05-26: AEGIS Background-Text horizontal in Landscape */
  #aegis-shield-container svg text {
    transform: rotate(0deg) !important;
    transform-origin: center !important;
    transform-box: fill-box !important;
  }
  .aegis-license-activation { transform: translateX(-40px) !important; }
  .aegis-license-quote { transform: translateX(35px) !important; }
  #aegis-sidebar#aegis-sidebar { padding: 16px 16px 16px 76px !important; }
  .aegis-logo-shield.aegis-logo-shield { width: 80px !important; height: 80px !important; opacity: 1 !important; filter: brightness(1.5) !important; }
  .aegis-logo-shield.aegis-logo-shield svg { width: 80px !important; height: 80px !important; opacity: 1 !important; }
  .aegis-logo.aegis-logo { margin-top: 60px !important; }
  .aegis-logo-name.aegis-logo-name { font-size: 20px !important; }
  .aegis-logo-brand.aegis-logo-brand { font-size: 20px !important; }
}


/* UNIVERSAL: AEGIS Text IMMER horizontal in Landscape (Breite > Hoehe) */
@media (orientation: landscape) {
  #aegis-shield-container svg text {
    transform: rotate(0deg) !important;
    transform-origin: center !important;
    transform-box: fill-box !important;
    font-size: 500px !important;
  }
}

/* RTL (Arabic) — Tablet License Box */
@media screen and (min-width: 769px) and (max-height: 800px) {
  [dir="rtl"] .aegis-license-activation {
    transform: translateX(-6px) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
  }
  [dir="rtl"] .aegis-license-key-container {
    transform: translateX(0px) !important;
    text-align: center !important;
    align-items: center !important;
  }
  [dir="rtl"] .aegis-license-quote {
    transform: translateX(0px) !important;
    text-align: center !important;
  }
  [dir="rtl"] #aegis-license-text {
    padding: 0 !important;
    text-align: center !important;
  }
}
@media (min-width: 768px) and (max-width: 1280px) and (min-height: 801px) {
  [dir="rtl"] .aegis-license-activation {
    transform: translateX(-6px) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
  }
  [dir="rtl"] .aegis-license-key-container {
    transform: translateX(0px) !important;
    text-align: center !important;
    align-items: center !important;
  }
  [dir="rtl"] .aegis-license-quote {
    transform: translateX(0px) !important;
    text-align: center !important;
  }
  [dir="rtl"] #aegis-license-text {
    padding: 0 !important;
    text-align: center !important;
  }
}

/* RTL (Arabic) — Tablet: Title + OFFLINE button 10px down */
@media (min-width: 768px) and (max-width: 1280px) and (min-height: 801px) {
  [dir="rtl"] .aegis-header.aegis-header {
    padding-top: 10px !important;
  }
}
@media screen and (min-width: 769px) and (max-height: 800px) {
  [dir="rtl"] .aegis-header.aegis-header {
    padding-top: 10px !important;
  }
}
