/* ============================================================
   responsive.css — Media Queries and Mobile Optimizations
   Personal Expense Tracker
   ============================================================ */

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

/* ── Desktop (992px - 1199px) ───────────────────────────────── */
@media (max-width: 1199.98px) {
  .hero-title {
    font-size: 2.4rem;
  }

  .card-amount {
    font-size: 1.8rem;
  }
}

/* ── Tablet (768px - 991px) ─────────────────────────────────── */
@media (max-width: 991.98px) {
  /* Section padding adjustments */
  #hero-section,
  #dashboard-section,
  #addexpense-section,
  #history-section,
  #analytics-section {
    padding: 2.5rem 0;
  }

  /* Hero */
  .hero-title {
    font-size: 2rem;
  }

  .hero-illustration-wrap img {
    max-width: 340px;
  }

  /* Balance Cards */
  .balance-cards-row {
    grid-template-columns: 1fr 1fr;
  }

  /* Keep remaining card full width */
  .balance-card--remaining {
    grid-column: span 2;
  }

  /* Analytics */
  .analytics-card {
    margin-bottom: 1.25rem;
  }
}

/* ── Mobile Large (576px - 767px) ───────────────────────────── */
@media (max-width: 767.98px) {
  /* Navbar */
  .brand-tagline {
    display: none;
  }

  /* Hero */
  #hero-section {
    padding: 2rem 0 1.5rem;
    text-align: center;
  }

  .hero-content {
    text-align: center;
  }

  .hero-badge {
    margin: 0 auto 1.2rem;
  }

  .hero-subtitle {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .hero-cta-row {
    justify-content: center;
  }

  .hero-stats-row {
    justify-content: center;
    gap: 1.5rem;
  }

  .hero-illustration-wrap {
    margin-top: 2rem;
    justify-content: center;
  }

  .hero-illustration-wrap img {
    max-width: 260px;
  }

  /* Balance Cards */
  .balance-cards-row {
    grid-template-columns: 1fr;
  }

  .balance-card--remaining {
    grid-column: span 1;
  }

  /* Dashboard header */
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }

  /* History header */
  .history-header {
    flex-direction: column;
    align-items: flex-start;
  }

  /* History controls */
  .history-controls {
    width: 100%;
    flex-direction: row;
    gap: 0.6rem;
  }

  .search-wrap {
    flex: 1;
  }
}

/* ── Mobile Small (< 576px) ─────────────────────────────────── */
@media (max-width: 575.98px) {
  /* Global spacing */
  #hero-section,
  #dashboard-section,
  #addexpense-section,
  #history-section,
  #analytics-section {
    padding: 1.75rem 0;
  }

  /* Typography */
  .hero-title {
    font-size: 1.75rem;
  }

  .section-title {
    font-size: 1.25rem;
  }

  /* Hero illustration smaller */
  .hero-illustration-wrap img {
    max-width: 220px;
  }

  /* Hero stats compact */
  .hero-stats-row {
    gap: 1rem;
  }

  .hero-stat-value {
    font-size: 1.2rem;
  }

  /* Balance card amounts */
  .card-amount {
    font-size: 1.7rem;
  }

  /* Add expense form */
  .add-expense-card {
    padding: 1.25rem 1rem;
  }

  /* Category grid — keep 4 columns but compact */
  .category-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
  }

  .category-chip {
    padding: 0.4rem 0.2rem;
    font-size: 0.62rem;
  }

  .category-chip .cat-emoji {
    font-size: 1rem;
  }

  /* Expense item compact */
  .expense-item {
    padding: 0.75rem 0.85rem;
    gap: 0.6rem;
  }

  .expense-cat-icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .expense-title {
    font-size: 0.85rem;
  }

  .expense-amount {
    font-size: 0.95rem;
  }

  /* Analytics */
  .analytics-card {
    padding: 1.25rem;
  }

  .spending-summary-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  .spending-summary-value {
    font-size: 1.1rem;
  }

  /* Modals */
  .modal-box {
    max-width: 100%;
    padding: 1.25rem 1rem;
  }

  .modal-footer-custom {
    flex-direction: column;
  }

  /* Toast */
  #toast-container {
    bottom: 0.75rem;
    right: 0.75rem;
    left: 0.75rem;
  }
}

/* ── Print Styles ───────────────────────────────────────────── */
@media print {
  #main-navbar,
  #addexpense-section,
  #analytics-section,
  .expense-actions,
  .btn-set-balance,
  .btn-reset-nav,
  #toast-container,
  .modal-overlay {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .balance-card {
    box-shadow: none;
    border: 2px solid #eee;
  }

  .expense-item {
    box-shadow: none;
    border-bottom: 1px solid #eee;
    break-inside: avoid;
  }
}
