/* ============================================
   Responsive Breakpoints
   sm: 640px, md: 768px, lg: 1024px, xl: 1280px
   ============================================ */

/* Mobile first - base styles are for mobile */

/* Small screens (640px+) */
@media (min-width: 640px) {
    .sm-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .sm-flex-row { flex-direction: row; }
    .sm-hidden { display: none !important; }
}

/* Medium screens (768px+) */
@media (min-width: 768px) {
    .md-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .md-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .md-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .md-flex-row { flex-direction: row; }
    .md-hidden { display: none !important; }
    .md-block { display: block !important; }
    .md-flex { display: flex !important; }
    .md-text-5xl { font-size: 3rem; }
    .md-text-7xl { font-size: 4.5rem; }
    .md-p-8 { padding: var(--space-8); }

    .header-inner {
        flex-direction: row;
    }

    .footer-top {
        flex-direction: row;
        justify-content: space-between;
    }

    .footer-nav {
        justify-content: flex-end;
    }

    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* Large screens (1024px+) */
@media (min-width: 1024px) {
    .lg-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .lg-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .lg-hidden { display: none !important; }
    .lg-block { display: block !important; }
    .lg-flex { display: flex !important; }
}

/* Extra large screens (1280px+) */
@media (min-width: 1280px) {
    .xl-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .xl-grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
}

/* Mobile specific (below 640px) */
@media (max-width: 639px) {
    .header-inner {
        flex-wrap: wrap;
    }

    .header-search {
        order: 3;
        max-width: 100%;
        width: 100%;
    }

    .header-controls {
        gap: var(--space-2);
    }

    .header-alert-options .btn span:not(.sr-only) {
        display: none;
    }

    .temp-unit-switch {
        font-size: 0.75rem;
    }

    h1 { font-size: 1.875rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }

    .dialog {
        min-width: auto;
        width: calc(100vw - 2rem);
        max-width: calc(100vw - 2rem);
        padding: var(--space-4);
    }

    .toast-container {
        left: var(--space-4);
        right: var(--space-4);
        max-width: none;
    }

    /* Social links: 44px touch target minimum */
    .social-link {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
        padding: 8px;
    }

    .social-link svg {
        width: 20px;
        height: 20px;
    }

    /* Card padding reduction for small screens */
    .card-header {
        padding: var(--space-4) var(--space-4) var(--space-2);
    }

    .card-content {
        padding: var(--space-2) var(--space-4) var(--space-4);
    }

    .card-footer {
        padding: var(--space-2) var(--space-4) var(--space-4);
    }

    /* Theme picker on small screens */
    .theme-picker-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .theme-picker-dropdown {
        right: -1rem;
        min-width: 260px;
    }

    /* Wizard panel mobile */
    .wizard-panel {
        max-width: 100%;
        padding: var(--space-3);
    }
}

/* Very small screens */
@media (max-width: 380px) {
    .highlight-boxes {
        grid-template-columns: 1fr;
    }

    .theme-picker-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Tablet specific (640px - 1023px) */
@media (min-width: 640px) and (max-width: 1023px) {
    .container {
        max-width: 720px;
        padding: 0 var(--space-6);
    }

    /* Tabs grid for tablet */
    .tabs-list {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Theme picker grid for tablet */
    .theme-picker-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    /* Footer nav wrapping */
    .footer-nav {
        gap: var(--space-3) var(--space-4);
    }
}

/* Print styles */
@media print {
    .header, .footer, .toast-container, .alerts-panel, .dialog-overlay {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }
}
