@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
    /* Brand Colors based on Depilando */
    --navy-deep: #212428;
    --navy-dark: #212428;
    --navy-mid: #e6d5c3;
    --blue-gray: #b08c8c;
    --terracotta: #cbb49c;
    --cream: #e6d5c3;
    
    /* Semantic Colors */
    --gold: #cbb49c;
    --gold-bright: #b09172;
    --gold-glow: rgba(203, 180, 156, 0.2);
    --gold-glow-strong: rgba(203, 180, 156, 0.35);
    
    --bg-color: #f4f0e8;
    --card-bg: rgba(255, 255, 255, 0.6);
    --text-primary: #212428;
    --text-secondary: #3a3d42;
    --text-muted: rgba(33, 36, 40, 0.6);
    
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(33, 36, 40, 0.12);
    
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
}

/* Light Mode Theme */
body.light-mode {
    --bg-color: #f4f0e8;
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-primary: #212428;
    --text-secondary: #3a3d42;
    --text-muted: rgba(33, 36, 40, 0.6);
    
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(33, 36, 40, 0.15);
    
    --gold: #cbb49c;
    --gold-bright: #b09172;
    --gold-glow: rgba(203, 180, 156, 0.2);
    --gold-glow-strong: rgba(203, 180, 156, 0.35);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
    background-image: none;
}

h1, h2, h3, .serif {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: var(--gold);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(169, 196, 231, 0.3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(169, 196, 231, 0.5); }

/* Glassmorphism Classes */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* =========================================================
   LOGIN SCREEN
   ========================================================= */
#login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100vw;
    height: 100vh;
    padding: 20px;
    position: fixed;
    top: 0; left: 0;
    z-index: 100;
    background: var(--bg-color);
    transition: opacity 0.4s ease;
}

.login-box {
    width: 100%;
    max-width: 420px;
    padding: 40px;
    text-align: center;
    animation: fadeInUp 0.6s ease-out;
}

.login-box h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.login-box p {
    color: var(--text-secondary);
    margin-bottom: 35px;
    font-size: 0.95rem;
}

.login-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    margin-top: 5px;
}
.login-links a {
    color: var(--gold);
    font-size: 0.85rem;
    text-decoration: none;
    transition: opacity 0.2s;
}
.login-links a:hover { opacity: 0.75; }

.form-group {
    margin-bottom: 22px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
    background: rgba(0, 0, 0, 0.4);
}

.btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--gold), var(--gold-bright));
    color: var(--navy-dark);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--gold-glow-strong);
    filter: brightness(1.1);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-secondary);
    box-shadow: none;
}

/* =========================================================
   DASHBOARD LAYOUT (Sidebar + Main)
   ========================================================= */
#app-container {
    display: none; /* Shown after login */
    width: 100vw;
    height: 100vh;
    display: flex; /* Override via JS but keep flex base */
}

/* Sidebar (Desktop) / Bottom Nav (Mobile) */
.sidebar {
    width: 260px;
    height: 100vh;
    background: var(--card-bg);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    position: fixed;
    left: 0; top: 0;
    z-index: 50;
    transition: transform 0.3s ease;
}

.brand {
    padding: 0 24px 30px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 20px;
}

.brand h1 {
    font-size: 1.6rem;
    line-height: 1.1;
}
.brand p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}

.nav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 0 15px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid transparent;
    white-space: nowrap;
}

.nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.nav-link.active {
    color: var(--gold);
    background: var(--gold-glow);
    border-color: rgba(169, 196, 231, 0.2);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--glass-border);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 260px;
    height: 100vh;
    overflow-y: auto;
    padding: 40px;
    animation: fadeIn 0.8s ease-out;
    padding-bottom: 40px; /* Safe area for desktop */
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.greeting h2 {
    font-size: 2rem;
    margin-bottom: 5px;
}

.greeting p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 8px 16px;
    border-radius: 999px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--terracotta));
    color: var(--navy-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'DM Serif Display', serif;
    font-size: 1.1rem;
}

/* Content Sections */
.content-section {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.content-section.active {
    display: block;
}

/* Summary Grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: var(--gold);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--gold-glow);
    color: var(--gold);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.4rem;
}

.stat-info h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-info .value {
    font-family: 'DM Serif Display', serif;
    font-size: 2.2rem;
    color: var(--text-primary);
    line-height: 1;
}

/* Panels */
.panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
}

.panel-header h3 {
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-header h3 i {
    font-size: 1.1rem;
    opacity: 0.8;
}

/* Data Lists */
.data-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.data-item {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--glass-border);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s, background 0.2s;
}

.data-item:hover {
    transform: translateX(4px);
    background: rgba(0, 0, 0, 0.25);
    border-left-color: var(--gold);
}

.item-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.item-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.item-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.item-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-agendada { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.status-completada { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.status-pendiente { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.3;
}

/* Profile Form */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.profile-avatar-sec {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    border: 1px dashed var(--glass-border);
    border-radius: 12px;
    margin-bottom: 24px;
}

.profile-avatar-sec .user-avatar {
    width: 80px;
    height: 80px;
    font-size: 2rem;
    margin-bottom: 15px;
}

/* Catalog Specifics */
.catalog-container {
    display: flex; 
    gap: 20px; 
    min-height: 350px; 
    background: rgba(0,0,0,0.1); 
    border: 1px solid var(--glass-border); 
    border-radius: 12px; 
    overflow: hidden;
}

.catalog-sidebar {
    width: 200px; 
    background: rgba(0,0,0,0.2); 
    border-right: 1px solid var(--glass-border); 
    display: flex; 
    flex-direction: column;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Loader */
#loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s;
}

.loader {
    width: 50px;
    height: 50px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile Responsiveness */
.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--gold);
    font-size: 1.5rem;
    padding: 5px 10px;
    border-radius: 8px;
    cursor: pointer;
}

@media (max-width: 992px) {
    /* Main Layout */
    .main-content { 
        margin-left: 0; 
        padding: 20px; 
        padding-bottom: 100px; /* Space for bottom nav */
    }
    
    /* Topbar adjustments */
    .greeting h2 { font-size: 1.5rem; }
    
    /* Sidebar becomes Bottom Nav */
    .sidebar { 
        width: 100vw; 
        height: auto; 
        top: auto; 
        bottom: 0; 
        flex-direction: row; 
        padding: 0; 
        border-right: none; 
        border-top: 1px solid var(--glass-border);
        background: rgba(16, 55, 84, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        transform: none !important;
        align-items: center;
    }
    
    .brand, .sidebar-footer { display: none; } /* Hide logo and footer buttons on mobile bottom bar */
    
    .nav-menu { 
        flex-direction: row; 
        overflow-x: auto; 
        padding: 10px; 
        gap: 15px; 
        width: 100%;
        scroll-snap-type: x mandatory;
        scrollbar-width: none; /* Firefox */
    }
    .nav-menu::-webkit-scrollbar { display: none; } /* Chrome */
    
    .nav-link { 
        flex-direction: column; 
        gap: 5px; 
        padding: 8px 12px; 
        font-size: 0.8rem; 
        border-radius: 12px;
        scroll-snap-align: center;
    }
    .nav-link i { font-size: 1.3rem; }
    
    /* Grids & Panels */
    .profile-grid { grid-template-columns: 1fr; }
    
    /* Visual Catalog Mobile */
    .catalog-container { 
        flex-direction: column; 
    }
    .catalog-sidebar { 
        width: 100%; 
        border-right: none; 
        border-bottom: 1px solid var(--glass-border); 
        flex-direction: row; 
        overflow-x: auto; 
        white-space: nowrap;
    }
    .catalog-family-item { 
        display: inline-block; 
        border-bottom: none !important; 
        border-left: none !important;
        border-bottom: 3px solid transparent !important;
    }
    /* When active on mobile */
    .catalog-family-item[style*="border-left"] {
        border-left: none !important;
        border-bottom: 3px solid var(--gold) !important;
    }
}

/* =========================================================
   NATIVE BOOKINGPRESS-STYLE UI (AGENDAR CITA)
   ========================================================= */
.booking-container {
    display: flex;
    gap: 0;
    align-items: stretch;
    min-height: 500px;
    padding: 0;
    overflow: hidden;
}

.booking-sidebar {
    width: 250px;
    background: var(--card-bg);
    border-right: 1px solid var(--glass-border);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.booking-tab {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-secondary);
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.booking-tab:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.03);
}

.booking-tab.active {
    background: var(--gold-glow);
    border-left-color: var(--gold);
    color: var(--gold);
}

.booking-tab.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tab-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.booking-body {
    flex: 1;
    padding: 30px;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.booking-step {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Service Pills */
.bpa-front-ci-pill {
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.bpa-front-ci-pill:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.bpa-front-ci-pill.active {
    background: var(--gold);
    color: var(--navy-dark);
    font-weight: 600;
    border-color: var(--gold);
}

/* Service Cards */
.bpa-front-si-card {
    padding: 20px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: var(--glass-bg);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 120px;
}

.bpa-front-si-card:hover {
    border-color: var(--gold);
    box-shadow: 0 0 15px var(--gold-glow);
    transform: translateY(-2px);
}

.bpa-front-si-card.active {
    border-color: var(--gold);
    box-shadow: 0 0 15px var(--gold-glow);
    background: rgba(169, 196, 231, 0.05);
}

.bpa-si-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.3;
}

.bpa-si-duration {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.bpa-si-price {
    font-weight: 700;
    color: var(--gold);
    font-size: 1.1rem;
    align-self: flex-start;
}

/* Calendar specifics */
.btn-calendar-day {
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.btn-calendar-day:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.1) !important;
}

@media (max-width: 768px) {
    .booking-container {
        flex-direction: column;
    }
    .booking-sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
    }
    .booking-tab {
        padding: 15px;
        flex-direction: column;
        gap: 5px;
        border-left: none;
        border-bottom: 3px solid transparent;
        white-space: nowrap;
    }
    .booking-tab.active {
        border-left: none;
        border-bottom-color: var(--gold);
    }
    .booking-datetime-grid {
        grid-template-columns: 1fr !important;
    }
}
