/* ============================
   Desktop Polish Overrides
   ============================ */

@media (min-width: 1024px) {

    /* 1. Hero Spacing */
    .hero,
    .vibrant-hero {
        padding-top: calc(var(--header-height) + 6rem) !important;
        padding-bottom: 8rem !important;
    }

    .hero-content {
        max-width: 900px !important;
    }

    .hero-title {
        font-size: 4rem !important;
    }

    .hero-subtext {
        font-size: 1.25rem !important;
        max-width: 700px !important;
    }

    /* 2. Feature Grid - Chunkier Cards */
    .features-section {
        gap: 2.5rem !important;
        margin-top: 6rem !important;
        margin-bottom: 6rem !important;
        /* Force slightly larger minimum width for cards to look premium */
        grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)) !important;
    }

    .feature-card {
        padding: 3rem !important;
    }

    /* 3. Service Bubbles - Larger */
    .service-bubbles {
        gap: 3rem !important;
        max-width: 1100px !important;
    }

    .bubble {
        width: 190px !important;
        height: 190px !important;
        font-size: 1.3rem !important;
        border-radius: 45px !important;
    }

    /* 4. Nav Links - Breathing Room */
    .nav-links {
        gap: 2rem !important;
        position: static !important;
        transform: none !important;
        background: transparent !important;
        width: auto !important;
        height: auto !important;
        flex-direction: row !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
        pointer-events: auto !important;
        opacity: 1 !important;
        display: flex !important;
    }

    /* Reset link styles for desktop header */
    .nav-link {
        font-size: 1rem !important;
        color: rgba(255, 255, 255, 0.9) !important;
        padding: 0.5rem 1rem !important;
        margin: 0 !important;
        font-weight: 500 !important;
        border-radius: 8px !important;
    }

    .nav-link:hover {
        background: rgba(255, 255, 255, 0.15) !important;
        color: #fff !important;
    }

    .nav-link.active {
        background: rgba(255, 255, 255, 0.25) !important;
        color: #fff !important;
        border: none !important;
    }

    /* Hide Mobile Elements on Desktop */
    .hamburger {
        display: none !important;
    }

    .nav-identity,
    .nav-divider,
    .nav-bottom {
        display: none !important;
    }

    .nav-content-wrap {
        padding: 0 !important;
        flex-direction: row !important;
        width: auto !important;
        overflow: visible !important;
    }

    /* Organize Header Groups */
    .nav-primary,
    .nav-secondary,
    .nav-guest {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 0.5rem !important;
    }

    /* Premium Button Desktop */
    .nav-special {
        margin: 0 !important;
        margin-left: 1rem !important;
    }

    .premium-btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.95rem !important;
    }

    /* Specific Link Tweaks */
    .icon {
        display: none !important;
        /* Keep icons hidden on desktop header as requested or optional? User said "migrate buttons onto top overlay" usually implies text links. Keeping icons hidden for clean look. */
    }

    .logo {
        margin-right: 2rem;
    }


    /* 5. Support Page Fixes */
    .support-card {
        padding: 4rem !important;
        max-width: 700px !important;
    }
}

/* Auth Pages Desktop Polish */
@media (min-width: 1024px) {
    .auth-container-wrapper {
        padding-top: 6rem !important;
    }

    .auth-section-card {
        max-width: 550px !important;
        padding: 4rem !important;
    }
}

/* ============================
   7. DASHBOARD AESTHETIC OVERHAUL
   ============================ */

/* Main Container & Grid Ratio */
@media (min-width: 1024px) {
    .dashboard {
        max-width: 1400px !important;
        margin: 0 auto !important;
        padding: 3rem 4rem !important;
    }

    .dashboard-grid {
        display: grid !important;
        grid-template-columns: 2.5fr 1fr !important;
        /* Balanced Ratio */
        gap: 2.5rem !important;
        align-items: start !important;
    }

    /* Spacing improvements */
    .appointments-card,
    .hours-card,
    .main-content .card {
        margin-bottom: 2.5rem !important;
    }

    /* Ensure View Calendar button is visible */
    .btn.small,
    button.small {
        display: inline-flex !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    /* ----------------------------------------------------------
       CALENDAR MODAL FIX (Center on Desktop)
       ---------------------------------------------------------- */
    .calendar-modal {
        /* Override mobile bottom-sheet style */
        align-items: center !important;
        justify-content: center !important;
        background: rgba(15, 23, 42, 0.6) !important;
        backdrop-filter: blur(8px) !important;
        padding: 2rem !important;
    }

    .calendar-content {
        /* Reset mobile styles */
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        transform: none !important;
        width: 100% !important;
        max-width: 500px !important;
        border-radius: 24px !important;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
        animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
        max-height: 85vh !important;
        display: flex !important;
        flex-direction: column !important;
    }

    @keyframes modalPop {
        0% {
            opacity: 0;
            transform: scale(0.95) translateY(10px);
        }

        100% {
            opacity: 1;
            transform: scale(1) translateY(0);
        }
    }
}

/* ----------------------------------------------------------
   HOURS EDITOR OVERHAUL (Professional Look)
   ---------------------------------------------------------- */
.hours-collapse {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    visibility: hidden;
}

.hours-collapse.active {
    opacity: 1;
    visibility: visible;
    max-height: 1200px !important;
    /* Ample height for expansion */
    padding-top: 2rem;
    margin-top: 1.5rem;
    border-top: 1px solid rgba(14, 165, 233, 0.1);
}

.hours-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

/* Floating Row Style */
.hours-row {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    /* Label - Toggles/Inputs - Status */
    align-items: center;
    padding: 0.8rem 1.25rem;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    border: 1px solid rgba(14, 165, 233, 0.1);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.hours-row:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 10px 20px -5px rgba(14, 165, 233, 0.15);
    border-color: rgba(14, 165, 233, 0.4);
    z-index: 2;
}

.hours-row.closed {
    opacity: 0.6;
    background: transparent;
    border-style: dashed;
}

.day-label {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
    letter-spacing: 0.02em;
}

.day-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Modern Toggle Switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input:checked+.slider {
    background: linear-gradient(135deg, var(--sky-blue), var(--teal));
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/* Time Inputs */
.time-range {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 1;
    transition: opacity 0.2s;
}

.hours-row.closed .time-range {
    pointer-events: none;
    opacity: 0.3;
}

.time-range input {
    border: 1px solid rgba(203, 213, 225, 0.6);
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
    width: 105px;
    background: rgba(255, 255, 255, 0.8);
    font-family: inherit;
    color: var(--text-main);
    transition: all 0.2s;
    text-align: center;
}

.time-range input:focus {
    border-color: var(--sky-blue);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
    background: #fff;
    outline: none;
}

.time-range span {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Save Check Animation */
.save-check {
    width: 20px;
    height: 20px;
    color: var(--teal);
    opacity: 0;
    transition: opacity 0.3s;
    margin-left: auto;
    /* Push to right */
}


/* Premium Card Styling (Glassmorphism++) */
@media (min-width: 1024px) {

    .card,
    .central-card,
    .auth-glass-card,
    .appointments-card,
    .hours-card,
    .promo-card,
    .dash-head {
        background: rgba(255, 255, 255, 0.8) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        border: 1px solid rgba(255, 255, 255, 0.6) !important;
        box-shadow:
            0 20px 40px -10px rgba(14, 165, 233, 0.1),
            0 10px 20px -5px rgba(0, 0, 0, 0.04),
            inset 0 0 0 1px rgba(255, 255, 255, 0.5) !important;
        border-radius: 24px !important;
        transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease !important;
    }

    .card:hover,
    .appointments-card:hover,
    .hours-card:hover {
        transform: translateY(-4px) !important;
        box-shadow:
            0 25px 50px -12px rgba(14, 165, 233, 0.15),
            0 10px 20px -5px rgba(0, 0, 0, 0.04) !important;
    }
}

/* Dark Mode Overrides for Premium Cards */
[data-theme="dark"] .card,
[data-theme="dark"] .appointments-card,
[data-theme="dark"] .hours-card,
[data-theme="dark"] .dash-head {
    background: rgba(30, 41, 59, 0.7) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4) !important;
}

/* Dashboard Header Typography */
@media (min-width: 1024px) {
    .dash-head {
        padding: 2.5rem 3rem !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    .dash-title {
        font-size: 2.25rem !important;
        letter-spacing: -0.02em !important;
        background: linear-gradient(135deg, var(--text-main) 0%, var(--text-muted) 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        margin-bottom: 0.5rem !important;
    }

    .status-badge {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.85rem !important;
        box-shadow: 0 4px 10px rgba(14, 165, 233, 0.2) !important;
    }
}

/* Table Polish */
@media (min-width: 1024px) {
    .table {
        border-collapse: separate !important;
        border-spacing: 0 0.8rem !important;
        /* Gap between rows */
    }

    .table thead th {
        border: none !important;
        background: transparent !important;
        padding-bottom: 0.5rem !important;
        padding-left: 1.5rem !important;
        font-size: 0.8rem !important;
        text-transform: uppercase !important;
        letter-spacing: 0.05em !important;
        color: var(--text-muted) !important;
    }

    .table tbody tr {
        background: rgba(255, 255, 255, 0.5) !important;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02) !important;
        transition: transform 0.2s ease, background 0.2s ease !important;
    }

    .table tbody tr:hover {
        transform: scale(1.01) !important;
        background: rgba(255, 255, 255, 0.9) !important;
        box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05) !important;
    }

    .table td {
        border: none !important;
        padding: 1.25rem 1.5rem !important;
        font-size: 0.95rem !important;
    }

    .table td:first-child {
        border-top-left-radius: 12px !important;
        border-bottom-left-radius: 12px !important;
    }

    .table td:last-child {
        border-top-right-radius: 12px !important;
        border-bottom-right-radius: 12px !important;
    }

    [data-theme="dark"] .table tbody tr {
        background: rgba(255, 255, 255, 0.03) !important;
    }

    [data-theme="dark"] .table tbody tr:hover {
        background: rgba(255, 255, 255, 0.06) !important;
    }
}

/* Photo Gallery Grid Polish */
@media (min-width: 1024px) {
    .photo-gallery {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1rem !important;
    }

    .photo-item {
        border-radius: 16px !important;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
        transition: transform 0.3s ease !important;
    }

    .photo-item:hover {
        transform: scale(1.05) !important;
        z-index: 5 !important;
    }
}

/* ----------------------------------------------------------
   MOBILE DASHBOARD FIXES (Consolidated)
   ---------------------------------------------------------- */
@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }

    .dash-head {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        padding: 2rem 1.5rem !important;
        gap: 1.5rem !important;
    }

    .dash-head>div {
        flex-direction: column !important;
        gap: 1rem !important;
    }

    .dash-head-actions {
        width: 100% !important;
        justify-content: center !important;
        margin-top: 1rem !important;
    }

    .dash-head-actions .nav-action-btn,
    .dash-head-actions .btn {
        width: 100% !important;
        justify-content: center !important;
    }

    .photo-gallery {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }

    /* Table Mobile Card View fallback */
    .table-scroll {
        overflow-x: auto !important;
        border: 1px solid rgba(0, 0, 0, 0.05) !important;
        box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.02) !important;
    }
}