/* Mobile Responsive Styles */

/* Mobile Navigation */
@media (max-width: 768px) {
  .nav-inner {
    border-radius: 16px !important;
    padding: 12px 16px !important;
    flex-wrap: wrap;
  }

  .logo {
    font-size: 18px !important;
  }

  .logo img {
    height: 28px !important;
  }

  .links {
    display: none;
    position: fixed;
    top: 70px;
    left: 16px;
    right: 16px;
    background: rgba(31, 31, 31, 0.98);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    flex-direction: column;
    gap: 8px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    z-index: 99;
  }

  .links.mobile-open {
    display: flex;
  }

  .links a {
    padding: 12px;
    border-radius: 8px;
    transition: background 0.2s;
  }

  .links a:hover {
    background: var(--bg-secondary);
  }

  .nav-dropdown {
    width: 100%;
  }

  .nav-dropdown .dropdown-menu {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    box-shadow: none;
    background: var(--bg-secondary);
    margin-top: 8px;
    border-radius: 8px;
    padding: 8px;
  }

  .nav-dropdown .dropdown-menu a {
    padding: 10px 12px;
  }

  .mobile-menu-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text);
    font-size: 18px;
    margin-left: auto;
  }

  .nav-actions {
    gap: 8px !important;
  }

  #social-links-nav {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .mobile-menu-toggle {
    display: none !important;
  }
}

/* Mobile Container */
@media (max-width: 768px) {
  .container {
    padding: 80px 16px 40px !important;
  }

  .section {
    padding: 32px 0 !important;
  }

  .hero-card {
    padding: 32px 24px !important;
  }

  .hero h1 {
    font-size: 32px !important;
  }
}

/* Mobile Grid Layouts */
@media (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
  }

  .stat-card {
    padding: 16px !important;
  }

  .stat-number {
    font-size: 28px !important;
  }
}

/* Mobile Card Carousel */
@media (max-width: 768px) {
  .modpacks-list,
  .featured-spotlight .spotlight-grid {
    display: flex !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 16px !important;
    padding-bottom: 16px;
    -webkit-overflow-scrolling: touch;
  }

  .modpack,
  .spotlight-card {
    min-width: 280px !important;
    max-width: 280px !important;
    scroll-snap-align: start;
    flex-shrink: 0;
  }

  .modpack .thumb,
  .spotlight-image {
    height: 180px !important;
  }

  /* Scrollbar styling for mobile carousel */
  .modpacks-list::-webkit-scrollbar,
  .spotlight-grid::-webkit-scrollbar {
    height: 8px;
  }

  .modpacks-list::-webkit-scrollbar-track,
  .spotlight-grid::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 4px;
  }

  .modpacks-list::-webkit-scrollbar-thumb,
  .spotlight-grid::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
  }

  /* Carousel indicator */
  .carousel-indicator {
    display: block !important;
    text-align: center;
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 8px;
  }
}

@media (min-width: 769px) {
  .carousel-indicator {
    display: none !important;
  }
}

/* Mobile Footer */
@media (max-width: 768px) {
  .floating-footer .footer-inner {
    flex-direction: column !important;
    gap: 32px !important;
    padding: 32px 24px !important;
  }

  .footer-inner > div[style*="display: flex"] {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  .footer-inner img {
    height: 80px !important;
  }

  .footer-inner h4 {
    font-size: 14px !important;
    margin-bottom: 12px !important;
  }

  .footer-inner > div > div {
    width: 100% !important;
  }
}

/* Mobile Project Detail Page */
@media (max-width: 768px) {
  .project-detail > div:first-child {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center;
  }

  .project-detail img {
    width: 100px !important;
    height: 100px !important;
  }

  .project-detail h1 {
    font-size: 24px !important;
  }

  .project-detail .btn {
    width: 100%;
    justify-content: center;
  }

  .stat-badge {
    font-size: 12px !important;
    padding: 6px 10px !important;
  }
}

/* Mobile Compare Page */
@media (max-width: 768px) {
  .compare-selection {
    flex-direction: column !important;
  }

  #selected-list {
    flex-direction: column !important;
  }

  .selected-item {
    width: 100% !important;
  }

  #comparison-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #comparison-table table {
    min-width: 600px;
  }
}

/* Mobile Docs */
@media (max-width: 768px) {
  .docs-wrapper {
    flex-direction: column !important;
  }

  .docs-sidebar {
    position: static !important;
    width: 100% !important;
    max-height: none !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border);
    padding-bottom: 16px !important;
    margin-bottom: 24px !important;
  }

  .docs-content {
    padding: 0 !important;
  }

  .breadcrumb {
    font-size: 12px !important;
    flex-wrap: wrap !important;
  }
}

/* Mobile Chart */
@media (max-width: 768px) {
  .line-chart > div {
    flex-direction: column !important;
  }

  .line-legend {
    width: 100% !important;
    max-height: 200px !important;
    columns: 2;
    column-gap: 12px;
  }

  .legend-item {
    break-inside: avoid;
    margin-bottom: 8px;
  }
}

/* Mobile Forms and Inputs */
@media (max-width: 768px) {
  input[type="search"],
  input[type="text"],
  select,
  textarea {
    font-size: 16px !important; /* Prevents zoom on iOS */
    padding: 12px !important;
  }

  .filters {
    flex-direction: column !important;
    gap: 12px !important;
  }

  .filters > * {
    width: 100% !important;
  }
}

/* Mobile Buttons */
@media (max-width: 768px) {
  .btn {
    padding: 12px 20px !important;
    font-size: 14px !important;
  }

  .cta-row {
    flex-direction: column !important;
    gap: 12px !important;
  }

  .cta-row .btn {
    width: 100%;
  }
}

/* Mobile Tables */
@media (max-width: 768px) {
  .card table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .card table th,
  .card table td {
    min-width: 120px;
    font-size: 13px;
    padding: 8px !important;
  }
}

/* Touch-friendly spacing */
@media (max-width: 768px) {
  a,
  button,
  .btn,
  [role="button"] {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Prevent horizontal scroll */
@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  * {
    max-width: 100%;
  }

  img {
    height: auto;
  }
}

/* Mobile pill/badge wrapping */
@media (max-width: 768px) {
  .pill-row,
  .pill-section {
    gap: 6px !important;
  }

  .pill {
    font-size: 11px !important;
    padding: 4px 8px !important;
  }

  .version-badge {
    font-size: 11px !important;
    padding: 4px 8px !important;
  }
}
