/* ========================================
   MOBILE RESPONSIVE STYLES
   Mobile drawer, overlays, and responsive layout
   ======================================== */

/* Mobile drawer and overlay - hidden on desktop */
.mobile-drawer {
  display: none;
}

.mobile-drawer-overlay {
  display: none;
}

.mobile-search-overlay {
  display: none;
}

/* === MOBILE BREAKPOINT === */
@media (max-width: 968px) {
  /* === HEADER ADJUSTMENTS === */
  header {
    padding: 1rem 1.5rem;
    z-index: 1001 !important;
  }

  .header-container {
    gap: 1rem;
  }

  /* Hide desktop navigation */
  .header-center {
    display: none;
  }

  /* Show mobile menu toggle */
  .mobile-menu-toggle {
    display: block !important;
  }

  /* === SEARCH ADJUSTMENTS === */
  /* Keep search container visible but style it for mobile */
  .search-container {
    display: flex !important;
    flex: 0 0 auto !important;
  }

  /* Hide the search input box on mobile - only show icon */
  .search-box {
    display: none !important;
  }

  /* Style search toggle button for mobile */
  .search-toggle-btn {
    padding: 0.5rem !important;
  }

  .search-icon {
    width: 20px !important;
    height: 20px !important;
  }

  /* === MOBILE SEARCH OVERLAY === */
  .mobile-search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 72px, rgba(0, 0, 0, 0.9) 72px, rgba(0, 0, 0, 0.9) 100%);
    backdrop-filter: blur(4px);
    z-index: 999;
    padding-top: 6rem;
    padding-left: 1rem;
    padding-right: 1rem;
    padding-bottom: 1rem;
    animation: fadeInMobile 0.2s ease;
  }

  @keyframes fadeInMobile {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  .mobile-search-overlay.active {
    display: flex !important;
    align-items: flex-start;
    justify-content: center;
  }

  .mobile-search-content {
    background: var(--bg-card);
    width: calc(100% - 2rem);
    max-width: 500px;
    padding: 1.5rem;
    margin: 0 1rem;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 1002;
    animation: slideDown 0.3s ease;
  }

  @keyframes slideDown {
    from {
      transform: translateY(-20px);
      opacity: 0;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }

  .mobile-search-content input {
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all 0.2s ease;
  }

  .mobile-search-content input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    background: var(--bg-primary);
  }

  .mobile-search-content .dropdown-content {
    margin-top: 0.75rem;
    position: static;
    max-width: 100%;
    width: 100%;
    border-radius: 10px;
    box-sizing: border-box;
    left: 0 !important;
    right: auto !important;
    min-width: auto !important;
  }

  .mobile-search-content .dropdown-item {
    padding: 0.75rem;
    font-size: 0.95rem;
  }

  .mobile-search-content .platform-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* === MOBILE DRAWER STYLES === */
  .mobile-drawer {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    right: -100% !important;
    width: 280px !important;
    height: 100vh !important;
    background: var(--bg-secondary) !important;
    border-left: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-xl) !important;
    transition: right 0.3s ease !important;
    z-index: 9999 !important;
    overflow-y: auto !important;
    padding: 2rem 0 !important;
  }

  .mobile-drawer.open {
    right: 0 !important;
  }

  .mobile-drawer-overlay {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    z-index: 9998 !important;
  }

  .mobile-drawer-overlay.active {
    display: block !important;
  }

  .drawer-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
  }

  .drawer-nav {
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
  }

  .drawer-nav a {
    padding: 1rem 2rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s;
    border-bottom: 1px solid var(--border-color);
  }

  .drawer-nav a:hover {
    background: var(--bg-hover);
    color: var(--accent-blue-light);
  }

  .drawer-search {
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
  }

  .drawer-search input {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
  }

  /* === LAYOUT ADJUSTMENTS === */
  .main-container {
    flex-direction: column;
    padding: 0.5rem;
  }

  .main-content {
    padding: 1rem 0.5rem;
  }

  /* === TYPOGRAPHY ADJUSTMENTS === */
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.25rem; }
}

/* === SMALLER MOBILE BREAKPOINT === */
@media (max-width: 480px) {
  header {
    padding: 0.75rem 1rem;
  }

  .site-logo {
    height: 32px;
  }

  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }

  /* Additional mobile search fixes for very small screens */
  .mobile-search-content {
    width: calc(100% - 1rem);
    margin: 0 0.5rem;
    padding: 1rem;
  }

  .mobile-search-content .dropdown-content {
    margin-top: 0.5rem;
  }

  .mobile-search-content .dropdown-item {
    padding: 0.625rem;
    font-size: 0.9rem;
  }
}

/* === SIDEBAR RESPONSIVE === */
.sidebar {
  width: 300px;
  flex-shrink: 0;
}

@media (max-width: 1024px) {
  .main-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }
}
