/* ===========================================
   DeepAd Console - Mobile Responsive Styles
   =========================================== */

/* ===========================================
   PART 1: Portrait Mode Overlay
   =========================================== */

.portrait-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
  z-index: 99999;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  color: white;
  text-align: center;
}

.portrait-overlay-content {
  padding: 40px;
  max-width: 300px;
}

.portrait-overlay h2 {
  margin: 24px 0 12px;
  font-size: 22px;
  font-weight: 500;
  font-family: Arial, Roboto, sans-serif;
}

.portrait-overlay p {
  font-size: 15px;
  opacity: 0.8;
  font-family: Arial, Roboto, sans-serif;
  line-height: 1.5;
}

.rotate-icon {
  animation: rotate-hint 2s ease-in-out infinite;
}

@keyframes rotate-hint {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-20deg); }
  75% { transform: rotate(20deg); }
}

/* Show overlay on mobile portrait - CSS media query as fallback */
@media screen and (max-width: 768px) and (orientation: portrait) {
  .portrait-overlay {
    display: flex;
  }
}

/* Also show on tablets in portrait */
@media screen and (max-width: 1249px) and (orientation: portrait) and (min-width: 600px) {
  .portrait-overlay {
    display: flex;
  }
}


/* ===========================================
   PART 2: Mobile Navigation Dropdown
   =========================================== */

/* Desktop navigation - show normally on larger screens */
.button-container.desktop-nav {
  display: flex;
}

.button-container2.desktop-nav {
  display: none;
}

/* Mobile dropdown - hidden by default */
.mobile-nav-dropdown {
  display: none;
  position: relative;
  margin-left: 5em;  /* Match button-container margin to align next to logo */
}

/* At <=1500px: Hide desktop nav, show dropdown (always, not just landscape) */
@media screen and (max-width: 1500px) {
  .button-container.desktop-nav,
  .button-container {
    display: none !important;
  }

  .button-container2.desktop-nav,
  .button-container2 {
    display: none !important;
  }

  .mobile-nav-dropdown {
    display: block;
  }
}


/* Dropdown trigger button */
.mobile-nav-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 14px;
  background: white;
  border: 1px solid #dadce0;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: #3c4043;
  cursor: pointer;
  min-width: 140px;
  justify-content: space-between;
  font-family: Arial, Roboto, sans-serif;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  height: 36px;
}

.mobile-nav-trigger:hover {
  background: #f8f9fa;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.mobile-nav-trigger.open {
  background: white;
  border-color: #ff0000;
  box-shadow: 0 1px 3px rgba(255,0,0,0.15);
}

.mobile-nav-current {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-nav-current svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Dropdown arrow */
.dropdown-arrow {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.mobile-nav-trigger.open .dropdown-arrow {
  transform: rotate(180deg);
}


/* Dropdown menu - uses position: fixed to escape parent overflow:hidden */
.mobile-nav-menu {
  display: none;
  position: fixed;
  min-width: 200px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  overflow: hidden;
}

.mobile-nav-menu.open {
  display: block;
}


/* Dropdown items */
.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #3c4043;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  font-family: Arial, Roboto, sans-serif;
  border-bottom: 1px solid #f5f5f5;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.mobile-nav-item:last-child {
  border-bottom: none;
}

.mobile-nav-item:hover {
  background: #f7f7f7;
}

.mobile-nav-item.selected {
  background: #ffebeb;
  color: #ff0000;
}

.mobile-nav-item.selected:hover {
  background: #ffe0e0;
}

.mobile-nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.mobile-nav-item.selected svg path {
  fill: #ff0000;
}


/* ===========================================
   PART 3: Fixed Left Sidebar Layout
   =========================================== */

/* At >= 1700px the fixed left sidebar (.G5cKqf, 96px) is visible.
   Push main content right so it never overlaps with the sidebar.
   At < 1700px the sidebar is display:none so no offset is needed. */
@media (min-width: 1700px) {
  body:has(.G5cKqf) .T4LgNb {
    margin-left: 96px;
  }
}


/* ===========================================
   PART 4: Additional Mobile Adjustments
   =========================================== */

/* Ensure body doesn't scroll when overlay is visible */
body.portrait-locked {
  overflow: hidden !important;
  position: fixed;
  width: 100%;
  height: 100%;
}
