/* styles.css - Fashion Weather Application - Complete with Button Fix */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    min-height: 100vh;
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    font-family: "Helvetica Neue", Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
    display: flex;
    justify-content: center;
    align-items: stretch;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    padding: 8px 16px;
    background: #dc2626;
    color: #fff;
    z-index: 1000;
    border-radius: 4px;
}

.skip-link:focus,
.skip-link:focus-visible {
    left: 16px;
    top: 16px;
    width: auto;
    height: auto;
    outline: 2px solid #111;
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    border: 0;
}

.container {
    width: 100%;
    max-width: 1600px;
    background: white;
    display: flex;
    flex-direction: column;
    margin: 0 auto;
}

.main-layout {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    gap: 6px;
    padding-bottom: 16px;
}

.main-layout.has-results {
    flex: 1 0 auto;
}

/* Properly Sized Header */
.header {
    background: black;
    color: white;
    padding: 26px 16px 20px;
    text-align: center;
    flex-shrink: 0;
}

.header-content {
    position: relative;
    z-index: 2;
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.header h1 {
    font-size: 2.3rem;
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 6px;
}

.header p {
    font-size: 0.9rem;
    opacity: 0.8;
    font-weight: 300;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    justify-content: center;
}

.header-actions h1 {
    margin: 0;
    text-align: center;
    letter-spacing: 2px;
}

.auth-signout {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #dc2626;
    color: #fff;
    text-decoration: none;
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.auth-signout:hover {
    background: #b91c1c;
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.3);
    transform: translateY(-1px);
}

.auth-signout svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Input Section - Base Styles */
.input-section {
    padding: 12px clamp(10px, 2.4vw, 24px);
    background: transparent;
    border: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
    justify-content: flex-start;
    flex-shrink: 0;
}

.input-section.is-collapsed {
    display: none;
}

.input-section.mobile-collapsible.is-collapsed {
    display: none;
}

.input-section.is-compact {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0;
    padding: 10px clamp(12px, 3vw, 22px) 6px;
    justify-content: center;
    align-items: center;
}

.input-section.is-compact .form-group:not(.form-group--submit),
.input-section.is-compact #form-helper {
    display: none;
}

.input-section.is-compact .form-group--submit {
    display: flex;
}

.input-section.is-compact .btn {
    flex: 0 0 auto;
    max-width: 320px;
    min-width: 200px;
    height: 48px;
    margin: 0 auto;
}

.form-group {
    flex: 1 1 140px;
    min-width: 140px;
    max-width: 220px;
}

.form-group--location {
    min-width: 200px;
    flex: 1 1 200px;
}

.form-group--submit {
    display: flex;
    align-items: flex-end;
    flex: 1 1 160px;
    min-width: 160px;
}

.form-group--submit .btn {
    width: 100%;
    display: button;
}

.input-pane {
    max-width: 1180px;
    margin: 0 auto;
    padding: clamp(24px, 4vw, 40px) clamp(24px, 5vw, 48px) clamp(12px, 3vw, 28px);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: clamp(20px, 3vw, 28px);
}

.input-pane .input-section {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    justify-content: center;
    gap: clamp(16px, 2.5vw, 28px);
    border-radius: 0;
    border: none;
    box-shadow: none;
    padding: 0;
    background: transparent;
    width: 100%;
}

.input-pane .input-section .form-group {
    flex: 1 1 0;
    min-width: 160px;
    max-width: 220px;
}

.input-pane .input-section .form-group--location {
    flex: 1.5 1 260px;
    min-width: 240px;
}

.input-pane .input-section .form-group--submit {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
    min-width: 220px;
}

.input-pane .input-section .form-group--submit .btn {
    max-width: 260px;
    min-width: 220px;
}

.input-sidebar {
    display: none;
}

.input-sidebar__grid {
    display: grid;
}

.input-sidebar__tile {
    position: relative;
}

.input-sidebar__tile::after {
    content: '';
}

.form-group label {
    display: block;
    margin-bottom: 3px;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.8px;
    color: #666;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 9px 14px;
    border: 1.5px solid #ddd;
    border-radius: 6px;
    font-size: 0.92rem;
    background: white;
    transition: border-color 0.3s ease;
    height: 44px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #dc2626;
}

/* Button Styles */
.btn {
    background: #dc2626;
    color: white;
    border: none;
    padding: 0 24px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 6px;
    min-width: 140px;
    height: 44px;
    flex: 1 1 140px;
    margin-bottom: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.toggle-form-btn {
    display: none;
    margin: 8px auto 12px;
    align-self: center;
    width: min(1180px, calc(100% - 32px));
    padding-left: 20px;
    padding-right: 20px;
    text-align: center;
    flex: 0 0 auto;
}

.btn:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.3);
}

input:focus-visible,
select:focus-visible,
button:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

/* Fashion Gallery */
.fashion-gallery {
    padding: 0;
    background: #fff;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.fashion-gallery.hidden {
    display: none;
}

.gallery-title {
    display: none;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    padding: 22px 22px 12px 22px;
    max-width: 1280px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    height: 300px;
    background: #f8f8f8;
}

.gallery-item--mobile-extra {
    display: none;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 15px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-item-overlay {
    transform: translateY(0);
}

.gallery-item-title {
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* Results Section */
.results-section {
    display: none;
    background: #fafafa;
    padding: 10px 5px;
    flex: 1;
    overflow-y: auto;
}

.results-section.show {
    display: block;
}

#resultsContainer {
    display: flex;
    flex-direction: column;
    gap: clamp(16px, 2vw, 24px);
    padding: 0 clamp(8px, 2vw, 24px) clamp(16px, 2vw, 32px);
}

/* Loading Spinner */
.loading {
    text-align: center;
    padding: 30px;
    display: none;
}

.loading.show {
    display: block;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #dc2626;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.spinner.small {
    width: 18px;
    height: 18px;
    border-width: 2px;
    margin: 0;
    display: inline-block;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: #666;
    font-size: 1rem;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(620px, 1fr));
    gap: clamp(20px, 2.5vw, 32px);
    max-width: 100%;
    margin: 0 auto;
    align-items: stretch;
}

.results-grid--compact {
    justify-content: center;
}

@media (min-width: 768px) {
    .results-grid--compact {
        grid-auto-rows: 1fr;
    }
}

.results-grid--single {
    width: 100%;
    max-width: 100%;
    justify-content: center;
    grid-template-columns: minmax(0, 1fr);
}

.result-card {
    background: #fff;
    border-radius: 10px;
    padding: clamp(16px, 2.5vw, 24px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
}

/* Compact Brand Card */
.brand-card {
    padding: 15px 20px !important;
    margin: 0 auto;
    width: 100%;
}

.brand-card h2 {
    font-size: 0.9rem !important;
    margin-bottom: 10px !important;
    font-weight: 600;
    color: #dc2626;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    text-align: center;
}

.brand-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    max-width: 100%;
    margin: 0 auto;
}

.brand-item {
    background: #f8f8f8;
    border: 1px solid #e0e0e0;
    border-radius: 14px;
    padding: 4px 10px;
    font-size: 0.75rem;
    color: #333;
    display: inline-block;
    margin: 2px;
    line-height: 1.3;
}

/* Advice Card Styles */
.advice-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.advice-card-header {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid #f0f0f0;
}

.advice-card-date {
    color: #dc2626;
    font-size: 1rem;
    font-weight: 500;
}

.advice-card-day {
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
}

.advice-card-day:empty {
    display: none;
}

.advice-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 18px;
}

.advice-card-content {
    display: grid;
    grid-template-columns: minmax(360px, 1.6fr) minmax(260px, 1fr);
    grid-template-areas: "text weather";
    gap: 24px;
    align-items: start;
}

.advice-card-weather {
    grid-area: weather;
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.advice-card-weather h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 10px;
    color: #666;
}

.weather-list {
    font-size: 0.8rem;
    line-height: 1.6;
}

.weather-details {
    background: #f9f9f9;
    padding: 12px;
    border-radius: 6px;
    font-size: 0.82rem;
    line-height: 1.6;
}

.weather-natural {
    margin-top: 10px;
    padding: 10px;
    background: #fafafa;
    border-left: 3px solid #3498db;
    font-style: italic;
    font-size: 0.78rem;
    color: #555;
}

.advice-narrative {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
    font-style: italic;
    color: #666;
    font-size: 0.75rem;
}

.advice-card-text {
    grid-area: text;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.advice-card-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: opacity 0.3s ease;
    position: relative;
}

.advice-card-section.updating {
    opacity: 0.5;
    pointer-events: none;
}

.advice-card-section.updating::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.advice-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    gap: 12px;
}

.advice-heading {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.advice-heading.day::before,
.advice-heading.evening::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 16px;
}

.advice-heading.day::before {
    background: #dc2626;
}

.advice-heading.evening::before {
    background: #6c757d;
}

.advice-text {
    color: #555;
    line-height: 1.6;
    font-size: 0.85rem;
    transition: opacity 0.3s ease;
}

/* Outfit and Accessories Lists */
.outfit-list,
.accessories-list {
    margin: 8px 0;
    padding-left: 20px;
}

.outfit-list li,
.accessories-list li {
    margin-bottom: 4px;
}

.styling-tips {
    font-size: 0.82rem;
    line-height: 1.5;
    margin-top: 8px;
}

.accessories-title {
    font-weight: 600;
    margin-top: 10px;
    margin-bottom: 5px;
}

/* Regenerate Buttons */
.regen-button {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #e0e0e0;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.regen-button:hover:not(.loading) {
    background: #f8f8f8;
    border-color: #999;
    transform: rotate(90deg);
}

.regen-button:active:not(.loading) {
    background: #f0f0f0;
    transform: rotate(90deg) scale(0.95);
}

.regen-button.loading {
    animation: spin 1s linear infinite;
    pointer-events: none;
    opacity: 0.6;
    cursor: not-allowed;
}

.regen-button:disabled {
    cursor: not-allowed;
}

.regen-icon {
    width: 12px;
    height: 12px;
    color: #666;
    transition: color 0.2s ease;
}

.regen-button:hover:not(.loading) .regen-icon {
    color: #333;
}

/* Action Buttons */
.advice-card-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.look-button {
    flex: 1 1 auto;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.8px;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    min-height: 64px;
    text-align: center;
}

.look-button.day {
    background: #dc2626;
    color: #fff;
}

.look-button.evening {
    background: #6c757d;
    color: #fff;
}

.look-button.loading {
    cursor: wait;
}

.look-button.disabled,
.look-button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.look-button:hover:not(.disabled):not(.loading) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.look-button-thumb-wrap,
.look-button-thumb {
    display: none;
}

.look-button-text {
    display: block;
    width: 100%;
}

/* Generated Images */
.advice-images {
    display: none;
    margin-top: 20px;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.advice-images.active {
    display: flex;
}

.generated-image-item {
    display: inline-block;
}

.generated-image-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.generated-image-frame {
    position: relative;
    display: inline-block;
}

.generated-image-label {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.generated-image {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.generated-image:hover {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

.image-love-button {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #dc2626;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, background 0.2s ease;
}

.image-love-button:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 1);
}

.image-love-button.loved {
    background: #dc2626;
    color: #fff;
}

.image-love-button.loved:hover {
    background: #b91c1c;
}

.image-love-icon {
    font-size: 1rem;
    line-height: 1;
}

.image-loading {
    text-align: center;
    padding: 20px;
    color: #666;
    background: #f8f8f8;
    border-radius: 6px;
    min-width: 250px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.image-error {
    text-align: center;
    padding: 20px;
    background: #fff3f3;
    border: 1px dashed #f5a5a5;
    border-radius: 6px;
    color: #b91c1c;
    min-width: 250px;
}

/* Collection Footer */
.collection-footer {
    text-align: center;
    padding: clamp(16px, 2vw, 24px);
    color: #999;
    font-size: 0.75rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin: 0 auto;
    width: 100%;
}

/* Footer */
.footer {
    background: black;
    color: white;
    padding: 14px;
    text-align: left;
    flex-shrink: 0;
    margin-top: auto;
}

.footer-content {
    position: relative;
    z-index: 2;
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.footer-content::before {
    display: none;
}

.footer p {
    font-size: 0.85rem;
    opacity: 0.8;
    font-weight: 300;
    letter-spacing: 0.8px;
    text-align: center;
    margin: 0;
    flex: 0 0 auto;
}

.footer-content a {
    color: inherit;
    text-decoration: none;
}

.footer-content a.footer-link {
    color: #ffffff;
    text-decoration: underline;
    font-weight: 500;
}

.footer-content a.footer-link:hover {
    color: rgba(255, 255, 255, 0.85);
}

.footer .auth-signout {
    margin-left: auto;
}

/* Responsive Design */

/* Large Desktop */
@media (min-width: 1400px) {
    .container {
        max-width: 1600px;
    }
    
    .header h1 {
        font-size: 2.5rem;
    }
    
    .gallery-item {
        height: 240px;
    }
    
    .gallery-grid {
        gap: 12px;
        padding: 18px 26px 20px 26px;
    }
}

/* Medium Desktop */
@media (min-width: 1200px) and (max-width: 1399px) {
    .gallery-item {
        height: 230px;
    }
}

@media (min-width: 1200px) {
    /* Desktop Input Section Overrides */
    .input-section {
        max-width: 1180px;
        margin: 0 auto;
        padding: 18px 24px 16px;
        flex-wrap: nowrap;
        gap: 16px;
        align-items: flex-end;
        width: 100%;
        background: transparent;
        border: none;
    }

    .input-section .form-group {
        flex: 1 1 160px;
        min-width: 140px;
        max-width: 200px;
    }

    .input-section .form-group--location {
        flex: 1.5 1 200px;
        min-width: 200px;
        max-width: 280px;
    }

    .input-section .form-group--submit {
        flex: 0 0 auto;
        min-width: 180px;
        padding-top: 0;
    }
    
    .input-section .form-group--submit .btn {
        width: 100%;
        min-width: 180px;
    }
    
    /* Override input-pane wrapper styles for desktop */
    .input-pane .input-section {
        border: none;
        box-shadow: none;
        background: transparent;
        padding: 0;
        border-radius: 0;
    }
    .main-layout.has-results .input-section {
    display: flex !important;
    }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1199px) {
    .header h1 {
        font-size: 2rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .gallery-item {
        height: 180px;
    }
    
    .results-grid {
        grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    }
    .main-layout.has-results .input-section {
        display: flex !important;
        }

}

@media (min-width: 992px) {
    .input-section {
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
        padding: 14px 24px;
    }

    .input-section .form-group {
        max-width: 200px;
    }

    .input-section .btn {
        flex: 0 0 auto;
        min-width: 150px;
        align-self: center;
    }
    .main-layout.has-results .input-section {
        display: flex !important;
        }
}

/* Small Tablet */
@media (min-width: 480px) and (max-width: 767px) {
    
    .input-section {
        flex-wrap: wrap;
    }
    .main-layout.has-results .input-section {
        display: flex !important;
        }

    .header-actions {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .auth-signout {
        width: 100%;
        justify-content: center;
        margin-right: 0;
    }

    .footer-content {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    .footer p {
        width: 100%;
    }

    .footer .auth-signout {
        margin-left: 0;
    }

    .footer-content {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    .footer p {
        width: 100%;
    }
    
    .form-group--submit {
        padding-top: 0;
    }
    
    .input-section.is-compact {
        padding: 12px 20px 8px;
    }

    .toggle-form-btn {
        width: calc(100% - 32px);
        margin: 8px auto 12px;
        padding-left: 20px;
        padding-right: 20px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 12px 18px;
    }
    
    .gallery-item {
        height: 160px;
    }

    .gallery-item--mobile-extra {
        display: block;
    }

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

    .advice-card-content {
        grid-template-columns: 1fr;
        grid-template-areas:
            "weather"
            "text";
        gap: 18px;
    }
}

/* Mobile */
@media (max-width: 767px) {
    #fashionGallerySection {
        order: 1;
        display: none !important;
    }

    #toggleFormButton {
        order: 2;
    }

    #fashion-form {
        order: 3;
    }

    #results {
        order: 4;
    }

    .toggle-form-btn {
        display: none !important;
    }

    .input-pane {
        flex-direction: column;
        gap: 12px;
        padding: 16px 14px 12px;
    }

    .input-pane .input-section {
        order: 1;
        padding: 12px 16px;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 12px;
        row-gap: 10px;
        align-items: end;
        box-shadow: 0 14px 26px rgba(15, 21, 36, 0.16);
        border-radius: 18px;
        background: #fff;
        border: 1px solid rgba(228, 228, 231, 0.9);
    }

    .input-pane .input-section .form-group {
        margin: 0;
    }

    .input-pane .input-section .form-group label {
        margin-bottom: 3px;
        font-size: 0.74rem;
        letter-spacing: 0.55px;
    }

    .input-pane .input-section .form-group input,
    .input-pane .input-section .form-group select {
        height: 36px;
        padding: 6px 12px;
    }

    .input-pane .input-section .form-group--location,
    .input-pane .input-section .form-group--submit {
        grid-column: span 2;
    }

    .input-pane .input-section .form-group--submit {
        display: flex;
        justify-content: center;
        align-items: center;
        padding-top: 0;
    }

    .input-pane .input-section .form-group--submit .btn {
        width: 100%;
        height: 38px;
        margin: 8px 0 0;
    }

    .input-pane .input-section.mobile-collapsible.is-collapsed {
        display: grid;
    }

    .input-sidebar {
        display: block;
        order: 2;
        margin: 0;
        padding: 0;
        background: none;
        box-shadow: none;
        border: none;
        width: 100%;
    }

    .input-sidebar__grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        padding: 0;
    }

    .input-sidebar__tile {
        min-height: 120px;
        border-radius: 18px;
        overflow: hidden;
        background-size: cover;
        background-position: center;
        position: relative;
        box-shadow: 0 18px 24px rgba(12, 16, 28, 0.22);
        isolation: isolate;
    }

    .input-sidebar__tile::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.28));
        mix-blend-mode: overlay;
        pointer-events: none;
    }
}

@media (max-width: 1100px) {
    .advice-card-content {
        grid-template-columns: minmax(280px, 1fr) minmax(240px, 0.9fr);
        grid-template-areas: "text weather";
        gap: 20px;
    }
}

@media (max-width: 479px) {
    
    .header h1 {
        font-size: 1.8rem;
    }

    .header-actions {
        flex-direction: column;
        gap: 8px;
    }

    .auth-signout {
        width: 100%;
        justify-content: center;
        margin-right: 0;
    }

    .footer-content {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
    
    .header {
        padding: 20px 12px 16px;
    }
    
    .input-pane .input-section {
        padding: 8px 14px;
        column-gap: 10px;
        row-gap: 8px;
    }

    .input-pane .input-section .form-group label {
        font-size: 0.7rem;
    }

    .input-pane .input-section .form-group input,
    .input-pane .input-section .form-group select {
        height: 34px;
        padding: 5px 9px;
    }

    .input-pane .input-section .form-group--submit .btn {
        height: 34px;
        margin-top: 6px;
    }

    .input-sidebar {
        padding: 0;
        border-radius: 18px;
        box-shadow: none;
    }

    .input-sidebar__grid {
        gap: 12px;
    }

    .input-sidebar__tile {
        min-height: 110px;
    }

    .toggle-form-btn {
        display: none !important;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        padding: 12px;
    }
    
    .gallery-item {
        height: 150px;
    }

    .gallery-item--mobile-extra {
        display: block;
    }

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

    .advice-card-content {
        grid-template-columns: 1fr;
        grid-template-areas:
            "weather"
            "text";
        gap: 16px;
    }

    .advice-card-weather,
    .advice-card-text {
        min-width: 100%;
    }
    
    .footer {
        padding: 20px;
    }
}

/* Height-based adjustments for compact screens */
@media (max-height: 768px) {
    .brand-card {
        padding: 12px 15px !important;
    }
    
    .brand-card h2 {
        font-size: 0.85rem !important;
        margin-bottom: 8px !important;
    }
    
    .brand-item {
        padding: 3px 8px;
        font-size: 0.7rem;
    }
    
    .result-card {
        padding: 15px;
    }
    
    .advice-card-weather {
        padding: 10px;
    }
    
    .advice-text {
        font-size: 0.8rem;
        line-height: 1.5;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #dc2626;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b91c1c;
}