/* ============================================
   Crystal Beauty — Premium Manicure Booking
   ============================================ */

:root {
    --bg-top: #F9F1F0;
    --bg-bottom: #E8EBF2;
    --glass-bg: rgba(255, 255, 255, 0.5);
    --glass-border: rgba(255, 255, 255, 0.7);
    --text-main: #332D2D;
    --text-secondary: #8E8484;
    --accent-rose: #C68E8E;
    --accent-dark: #2D241E;
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
    /* Gradient without attachment:fixed — works on mobile WebView */
    background: var(--bg-top);
    background-image: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
    background-repeat: no-repeat;
    min-height: 100vh;
    color: var(--text-main);
    display: flex;
    justify-content: center;
    overflow-x: hidden;
}

/* ---- App Container ---- */
.app-container {
    width: 100%;
    max-width: 500px;
    padding: 24px 20px 100px;
}

/* ---- Header ---- */
.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.avatar-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--glass-border);
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info h1 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: var(--text-main);
}

.profile-info p {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ---- Slots Widget ---- */
.slots-widget {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 18px 20px;
    margin-bottom: 32px;
    box-shadow: var(--card-shadow);
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.slot-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 15px;
    color: var(--text-secondary);
}

.slot-row:last-child {
    margin-bottom: 0;
}

.slot-row strong {
    font-weight: 600;
    color: var(--accent-rose);
}

/* ---- Services Scroll ---- */
.services-container {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 12px;
    margin-bottom: 24px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
}

.services-container::-webkit-scrollbar {
    display: none;
}

.service-card {
    flex: 0 0 240px;
    height: 320px;
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    border: 3px solid transparent;
    background: #f0e8e4;
}

.service-card:active {
    transform: scale(0.97);
}

.service-card.selected {
    border-color: var(--accent-rose);
    box-shadow: 0 6px 20px rgba(198, 142, 142, 0.35);
}

.service-img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.service-info {
    position: absolute;
    bottom: 12px;
    left: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.service-info h3 {
    margin: 0;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-main);
    margin-bottom: 3px;
}

.service-desc {
    font-size: 11px;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.service-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.duration {
    font-size: 11px;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.05);
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 500;
}

.price {
    font-weight: 600;
    color: var(--accent-rose);
    font-size: 14px;
}

/* ---- Calendar ---- */
.calendar-wrapper {
    margin-bottom: 24px;
}

.calendar-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 4px 2px 12px;
}

.calendar-strip::-webkit-scrollbar {
    display: none;
}

.day-item {
    flex: 0 0 58px;
    height: 74px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    transition: all 0.25s ease;
    cursor: pointer;
}

.day-item:active {
    transform: scale(0.95);
}

.day-item.active {
    background: var(--accent-rose);
    border-color: var(--accent-rose);
    color: white;
    box-shadow: 0 4px 12px rgba(198, 142, 142, 0.3);
}

.day-item span {
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    opacity: 0.65;
}

.day-item strong {
    font-size: 19px;
    font-weight: 600;
}

.day-item.active span {
    opacity: 1;
    color: white;
}

/* ---- Time Grid ---- */
.time-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}

.time-item {
    height: 46px;
    background: var(--glass-bg);
    border: 1.5px solid var(--glass-border);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    color: var(--text-main);
}

.time-item:active {
    transform: scale(0.95);
}

.time-item.active {
    border-color: var(--accent-rose);
    color: var(--accent-rose);
    background: white;
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(198, 142, 142, 0.2);
}

/* ============================================
   Confirmation Overlay (Fixed!)
   ============================================ */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    /* darkened background */
    backdrop-filter: blur(5px);
    z-index: 999999;
    /* Max z-index to stay above everything */
    display: none;
    /* Hide by default using display instead of opacity */
    align-items: center;
    justify-content: center;
}

.overlay.active {
    display: flex;
}

.confirm-card {
    background: white;
    width: 90%;
    max-width: 340px;
    border-radius: 20px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.close-overlay {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
}

.success-icon {
    display: none;
}

.confirm-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(198, 142, 142, 0.15);
    /* light accent background */
    color: var(--accent-rose);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    animation: pulseIcon 1.5s ease-in-out infinite alternate;
}

.confirm-icon svg {
    width: 32px;
    height: 32px;
    stroke: var(--accent-rose);
}

@keyframes pulseIcon {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.05);
    }
}

.confirm-card h2 {
    margin: 0 0 16px 0;
    color: var(--text-main);
    font-size: 20px;
}

#confirm-details {
    text-align: left;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.6;
    font-family: inherit;
    color: var(--text-main);
}

.confirm-note {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.done-btn {
    width: 100%;
    background: var(--accent-rose);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

/* Promo Section */
.promo-section {
    margin-top: 24px;
    padding: 0 4px;
}

.input-field-compact {
    display: flex;
    gap: 10px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 6px;
    border-radius: 12px;
}

.input-field-compact input {
    flex: 1;
    background: none;
    border: none;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-main);
    outline: none;
}

.input-field-compact button {
    background: var(--accent-rose);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
}

.promo-msg {
    font-size: 12px;
    margin-top: 8px;
    padding-left: 12px;
}

.promo-msg.success {
    color: #4CAF50;
}

.promo-msg.error {
    color: #f44336;
}

.loading {
    padding: 40px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
    grid-column: 1 / -1;
}