/* Desktop Large (1400px+) */
@media (max-width: 1400px) {
  .container {
    max-width: 1140px;
  }

  .grid-4 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Desktop (1200px) */
@media (max-width: 1200px) {
  .container {
    max-width: 960px;
  }

  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Laptop (1024px) */
@media (max-width: 1024px) {
  .container {
    max-width: 100%;
    padding: 0 20px;
  }

  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: flex;
  }

  .main-content {
    margin-left: 0;
    padding: calc(var(--header-height) + 24px) 20px 24px 20px;
  }

  .header-nav {
    display: none;
  }

  .header-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
    gap: 16px;
    animation: fadeIn 0.3s ease;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-2 {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 28px;
  }
}

/* Tablet (768px) */
@media (max-width: 768px) {
  html {
    font-size: 15px;
  }

  .header-logo {
    font-size: 18px;
  }

  .header-logo img {
    height: 30px;
  }

  .header-actions .btn span {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .grid-4,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: 24px;
  }

  .section-padding {
    padding: 60px 0;
  }

  .auth-card {
    padding: 28px 24px;
  }

  .page-title {
    font-size: 22px;
  }

  .welcome-name {
    font-size: 22px;
  }

  .welcome-section {
    padding: 24px;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-header-left {
    flex-direction: column;
    align-items: stretch;
  }

  .dashboard-search {
    min-width: 100%;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar .input-field,
  .filter-bar .select-field {
    width: 100%;
    min-width: 100%;
  }

  .content-card-header {
    flex-direction: column;
    align-items: stretch;
  }

  .table-container {
    margin: 0 -20px;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .modal {
    padding: 24px 20px;
    max-width: 95%;
  }

  .toast {
    min-width: 0;
    max-width: calc(100vw - 40px);
  }

  .referral-box {
    flex-direction: column;
  }

  .referral-box input {
    width: 100%;
  }

  .nft-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile (480px) */
@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .header-inner {
    padding: 0 16px;
  }

  .main-content {
    padding: calc(var(--header-height) + 20px) 16px 20px 16px;
  }

  .header-logo span {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .section-title {
    font-size: 20px;
  }

  .stat-card-value {
    font-size: 22px;
  }

  .auth-card {
    padding: 24px 20px;
  }

  .auth-header h1 {
    font-size: 20px;
  }

  .welcome-stats {
    flex-direction: column;
    gap: 12px;
  }

  .stats-grid {
    gap: 12px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .nft-grid {
    grid-template-columns: 1fr;
  }

  .matrix-node {
    width: 64px;
    height: 64px;
  }

  .matrix-node-icon {
    font-size: 16px;
  }
}

/* Large Mobile (360px) */
@media (max-width: 360px) {
  html {
    font-size: 14px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-card-icon {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
}

/* Sidebar overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 850;
}

.sidebar-overlay.active {
  display: block;
}

@media (max-width: 1024px) {
  .sidebar-overlay.active {
    display: block;
  }
}
