/* Mobile Layout Styles (<1024px) */
.mobile-header,
.tab-navigation {
  display: none;
}

/* Tab Content Visibility Management */
/* By default on mobile, we might need to hide everything and only show active */
/* But we rely on JS to add classes to the container or items */

@media (max-width: 1024px) {
  /* Enable scrolling on mobile/one-column */
  html, body {
    overflow: auto !important;
    height: auto;
    -webkit-overflow-scrolling: touch;
  }

  .main-content {
    height: auto;
    padding-top: 0;
  }

  .app-wrapper {
    min-height: 100vh;
    overflow: visible;
    padding-top: 0;
  }

  /* 1. Mobile Header */
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 60px;
    background-color: #1a1a1a;
    padding: 8px 12px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  }

  .mobile-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .mobile-logo-img {
    width: 40px;
    height: auto;
    margin-right: 12px;
  }
  
  /* Fallback text if logo image fails/isn't used */
  .mobile-logo-text {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--accent, #22c55e);
    font-size: 16px;
    margin-right: 12px;
  }

  .mobile-profile-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .mobile-profile-row {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
    width: 100%;
  }

  .mobile-profile-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 14px;
    color: #f5f5f5;
    line-height: 1.2;
  }

  .mobile-profile-handle {
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    color: #999;
    line-height: 1.2;
  }

  .mobile-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .mobile-action-btn {
    background: none;
    border: none;
    color: #f5f5f5;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* 2. Tab Navigation */
  .tab-navigation {
    display: none !important;
    width: 100%;
    background-color: #1a1a1a;
    position: fixed;
    top: 60px; /* Below header */
    left: 0;
    z-index: 999;
    border-bottom: 1px solid #333;
  }

  .nav-tab {
    flex: 1;
    text-align: center;
    padding: 12px 0;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    transition: color 0.2s ease;
  }

  .nav-tab.active {
    color: #f5f5f5;
  }

  .nav-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #FF2E5B;
  }

  /* 3. Main Content Adjustment */
  body {
    padding-top: 48px; /* Slightly above one grid cell (~48px) */
  }

  .app-wrapper {
    padding: 8px 10px; /* Reduce padding on mobile, top slightly tighter */
    padding-top: 0;
  }

  /* Hide Desktop Layout Elements or adjust them */
  /* We will toggle visibility via JS classes */
  
  /* Helper to hide sections that are not active */
  .mobile-hidden {
    display: none !important;
  }
  
  /* Reset Bento Grid for Mobile to single column */
  .bento-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    grid-template-columns: 1fr; /* Override grid */
    grid-template-rows: auto;
    margin-top: 0;
  }
  
  .bento-card {
    grid-column: auto !important;
    grid-row: auto !important;
    min-height: auto;
  }

  /* --- COMPACT LOGO CARD STYLES --- */
  .card-logo {
    display: flex !important; /* Ensure flex for centering if needed, or block */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px !important; /* Reduce padding */
    min-height: 120px !important; /* Reduce min-height significantly */
    height: auto !important;
  }

  /* Hide desktop admin button on mobile */
  .admin-dashboard-fixed {
    display: none !important;
  }

  /* Spacing for mobile content container */
  .mobile-specific-content {
    padding: 16px 12px 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
  }

  .card-logo .logo-tagline,
  .card-logo .logo-link,
  .card-logo .logo-version-pill {
    display: none !important;
  }

  .card-logo .logo-svg-container {
    height: 80px !important; /* Reduce SVG height */
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* --- BURGER MENU STYLES --- */
  .burger-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    display: flex;
    justify-content: flex-end; /* Slide from right */
  }

  .burger-menu-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  .burger-menu-content {
    width: 280px;
    height: 100%;
    background: #1a1a1a;
    padding: 24px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -2px 0 10px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .burger-menu-overlay.open .burger-menu-content {
    transform: translateX(0);
  }

  .burger-close-btn {
    align-self: flex-end;
    background: none;
    border: none;
    color: #999;
    font-size: 24px;
    cursor: pointer;
    padding: 4px;
  }

  .burger-menu-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 24px;
    font-weight: 700;
    color: var(--accent, #22c55e);
    margin: 0;
  }

  .burger-menu-tagline {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    color: #f5f5f5;
    margin: 0;
    line-height: 1.5;
  }

  .burger-menu-credits {
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    color: var(--accent, #22c55e);
    text-decoration: none;
  }

  .burger-menu-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
  }

  .burger-action-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #2a2a2a;
    border: 1px solid #333;
    padding: 12px 16px;
    border-radius: 8px;
    color: #f5f5f5;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .burger-action-btn:hover {
    background: #333;
    border-color: #444;
  }

  .burger-action-btn span {
    font-size: 16px;
  }

  .burger-action-btn.primary {
    background: var(--accent, #22c55e);
    color: #000;
    border: none;
  }

  .burger-action-btn.admin {
    border-color: #FFD700;
    color: #FFD700;
  }

  .burger-action-btn.logout {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
  }

  .burger-menu-divider {
    border: 0;
    border-top: 1px solid #333;
    width: 100%;
    margin: 8px 0;
  }

  .burger-menu-version {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: #666;
    margin-top: auto; /* Push to bottom */
  }

  /* --- SIDE MENU STYLES (new) --- */
  .side-menu-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    display: flex;
    justify-content: flex-end;
    -webkit-overflow-scrolling: touch;
  }

  .side-menu-overlay.side-menu-open {
    opacity: 1;
    pointer-events: auto;
  }

  .side-menu-panel {
    width: min(320px, 85vw);
    height: 100%;
    background: #141414;
    padding: 20px;
    box-shadow: -4px 0 18px rgba(0,0,0,0.45);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .side-menu-overlay.side-menu-open .side-menu-panel {
    transform: translateX(0);
  }

  .side-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
  }

  .side-menu-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
    font-weight: 700;
    color: #f5f5f5;
  }

  .side-menu-close {
    background: none;
    border: none;
    color: #999;
    font-size: 20px;
    cursor: pointer;
    padding: 6px;
  }

  .side-menu-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .side-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #1d1d1d;
    border: 1px solid #2d2d2d;
    padding: 12px 14px;
    border-radius: 10px;
    color: #f5f5f5;
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .side-menu-item:hover {
    background: #252525;
    border-color: #3a3a3a;
  }

  .side-menu-item.primary {
    background: var(--accent, #22c55e);
    color: #000;
    border: none;
  }

  .side-menu-item.logout {
    color: #ef4444;
    border-color: rgba(239,68,68,0.4);
  }

  .side-menu-item.dashboard {
    color: #FFD700;
    border-color: rgba(255,215,0,0.35);
  }

  .side-menu-footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: #999;
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
  }

  .side-menu-footer-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 700;
    color: var(--accent, #22c55e);
  }

  .side-menu-footer-subtitle {
    color: #aaa;
    font-size: 11px;
  }
}
