/* ═══════════════════════════════════════════════
   Princess Dashboard — Dreamy Pink Theme
   ═══════════════════════════════════════════════ */

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

:root {
    --bg-dark: #1a0a1e;
    --bg-card: rgba(40, 15, 50, 0.6);
    --pink: #ff6b9d;
    --pink-glow: #ff2d78;
    --rose: #ffb3d0;
    --lavender: #c9a0dc;
    --gold: #ffd4a8;
    --text: #f5e6f0;
    --text-muted: rgba(245, 230, 240, 0.55);
    --border: rgba(255, 107, 157, 0.2);
    --glass: rgba(60, 20, 70, 0.45);
    --font: 'Cairo', 'Tajawal', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--bg-dark);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(255, 45, 120, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(157, 0, 255, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 90%, rgba(255, 107, 157, 0.05) 0%, transparent 40%);
    color: var(--text);
    font-family: var(--font);
    min-height: 100vh;
    direction: rtl;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 107, 157, 0.3); border-radius: 3px; }

/* ── Ambient Particles ── */
.ambient-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ambient-particles .sparkle {
    position: absolute;
    border-radius: 50%;
    background: var(--pink);
    opacity: 0;
    animation: sparkle-float linear forwards;
}

@keyframes sparkle-float {
    0% { opacity: 0; transform: translateY(0) scale(0); }
    15% { opacity: 0.7; transform: scale(1); }
    85% { opacity: 0.4; }
    100% { opacity: 0; transform: translateY(-100vh) scale(0.3); }
}

/* ── Dashboard Layout ── */
.dashboard {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ── Sidebar ── */
.sidebar {
    position: sticky;
    top: 24px;
    height: fit-content;
}

.profile-card {
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
}

.profile-pic-wrap {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 16px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--pink);
    box-shadow: 0 0 25px rgba(255, 107, 157, 0.3);
}

.profile-pic {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pic-glow {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    box-shadow: inset 0 0 20px rgba(255, 107, 157, 0.2);
    pointer-events: none;
}

.profile-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--rose);
    margin-bottom: 4px;
}

.profile-status {
    font-size: 0.8rem;
    color: var(--pink);
    opacity: 0.8;
    margin-bottom: 20px;
}

.profile-stats {
    display: flex;
    gap: 12px;
}

.stat {
    flex: 1;
    background: rgba(255, 107, 157, 0.08);
    border: 1px solid rgba(255, 107, 157, 0.15);
    border-radius: 10px;
    padding: 12px 8px;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--pink);
    text-shadow: 0 0 12px rgba(255, 107, 157, 0.4);
}

.stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── Main Content ── */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.welcome-banner {
    background: linear-gradient(135deg, rgba(255, 107, 157, 0.12), rgba(157, 0, 255, 0.08));
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px 32px;
    backdrop-filter: blur(10px);
}

.welcome-banner h1 {
    font-size: 1.8rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 6px;
}

.welcome-banner p {
    font-size: 0.95rem;
    color: var(--rose);
    opacity: 0.8;
}

/* ── Protocol Grid ── */
.protocol-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    grid-template-rows: auto auto auto;
    gap: 16px;
}

.protocol-card {
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.protocol-card.card-active {
    grid-column: 1;
    grid-row: 1;
    background: var(--glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    cursor: pointer;
}

.protocol-card.card-active:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(255, 107, 157, 0.25);
    border-color: var(--pink);
}

.card-img-wrap {
    position: relative;
    height: 160px;
    overflow: hidden;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card-active:hover .card-img {
    transform: scale(1.06);
}

.card-img-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(26, 10, 30, 0.9) 5%, transparent 70%);
}

.card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 107, 157, 0.85);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    backdrop-filter: blur(6px);
}

.card-body {
    padding: 16px;
}

.card-body h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.card-body p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ── Locked Cards ── */
.card-locked {
    background: rgba(20, 8, 28, 0.4);
    border: 2px dashed rgba(255, 107, 157, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    cursor: not-allowed;
}

.card-locked:nth-child(2) { grid-column: 1; grid-row: 2; }
.card-big { grid-column: 2; grid-row: 1 / span 2; min-height: 320px; }
.card-bottom { grid-column: 1 / span 2; grid-row: 3; }

.card-locked:hover {
    border-color: rgba(255, 107, 157, 0.3);
    box-shadow: 0 0 15px rgba(255, 107, 157, 0.08);
}

.locked-content {
    text-align: center;
    padding: 20px;
}

.lock-icon {
    font-size: 2rem;
    opacity: 0.3;
    display: block;
    margin-bottom: 10px;
    animation: lock-breathe 3s ease-in-out infinite;
}

@keyframes lock-breathe {
    0%, 100% { opacity: 0.25; }
    50% { opacity: 0.5; }
}

.locked-tag {
    font-size: 0.7rem;
    color: var(--pink);
    background: rgba(255, 107, 157, 0.08);
    border: 1px solid rgba(255, 107, 157, 0.15);
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    margin-bottom: 8px;
    font-weight: 600;
}

.locked-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.6;
}

/* ── Cat Modal ── */
.cat-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    background: #0a0510;
}

.cat-modal.active {
    display: block;
}

.modal-close {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10005;
    background: rgba(255, 107, 157, 0.2);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 107, 157, 0.4);
    color: var(--rose);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-close:hover {
    background: rgba(255, 107, 157, 0.4);
    box-shadow: 0 0 20px rgba(255, 107, 157, 0.3);
}

.hearts-layer {
    position: fixed;
    inset: 0;
    z-index: 10003;
    pointer-events: none;
    overflow: hidden;
}

.heart-particle {
    position: absolute;
    bottom: -40px;
    animation: float-heart linear forwards;
    pointer-events: none;
    opacity: 0.7;
}

@keyframes float-heart {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    10% { opacity: 0.75; }
    90% { opacity: 0.4; }
    100% { transform: translateY(-105vh) rotate(40deg); opacity: 0; }
}

.dreamy-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: radial-gradient(ellipse at center, rgba(255, 107, 157, 0.12) 0%, rgba(10, 5, 16, 0.3) 100%);
    pointer-events: none;
}

.video-wrap {
    position: fixed;
    inset: 0;
    z-index: 10000;
}

.video-wrap video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vignette {
    position: fixed;
    inset: 0;
    z-index: 10002;
    box-shadow: inset 0 0 120px rgba(10, 5, 16, 0.7);
    pointer-events: none;
}

.affirmation-wrap {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10004;
    pointer-events: none;
}

.affirmation-text {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 107, 157, 0.8), 0 0 50px rgba(255, 107, 157, 0.4);
    animation: aff-pulse 0.7s infinite alternate ease-in-out;
    direction: rtl;
    text-align: center;
    padding: 0 24px;
    max-width: 90%;
    line-height: 1.3;
    transition: font-size 0.3s ease;
}

.affirmation-text.large {
    font-size: clamp(3.2rem, 11vw, 5.8rem);
}

@keyframes aff-pulse {
    0% { opacity: 0.85; text-shadow: 0 0 15px rgba(255, 107, 157, 0.6); }
    100% { opacity: 1; text-shadow: 0 0 25px rgba(255, 107, 157, 0.9), 0 0 50px rgba(201, 160, 220, 0.5); }
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .dashboard {
        grid-template-columns: 1fr;
        padding: 24px;
        gap: 20px;
    }
    .sidebar {
        position: static;
    }
    .profile-card {
        display: flex;
        align-items: center;
        text-align: right;
        padding: 20px;
        gap: 24px;
    }
    .profile-pic-wrap {
        width: 100px;
        height: 100px;
        margin: 0;
        flex-shrink: 0;
    }
    .profile-info {
        flex-grow: 1;
    }
    .profile-stats {
        margin-top: 0;
    }
    .protocol-grid {
        grid-template-columns: 1fr 1fr;
    }
    .card-active {
        grid-column: 1;
        grid-row: 1;
    }
    .card-locked:nth-child(2) {
        grid-column: 1;
        grid-row: 2;
    }
    .card-big {
        grid-column: 2;
        grid-row: 1 / span 2;
        min-height: 280px !important;
    }
    .card-bottom {
        grid-column: 1 / span 2;
        grid-row: 3;
    }
    .welcome-banner h1 { font-size: 1.6rem; }
}

@media (max-width: 768px) {
    .profile-card {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    .profile-stats {
        width: 100%;
        justify-content: center;
    }
    .protocol-grid {
        grid-template-columns: 1fr;
    }
    .card-active, .card-locked:nth-child(2), .card-big, .card-bottom {
        grid-column: auto !important;
        grid-row: auto !important;
        min-height: 120px !important;
    }
    .welcome-banner h1 { font-size: 1.3rem; }
    .affirmation-text { font-size: clamp(2rem, 7vw, 3.5rem); }
}

/* ── Modal Loading Overlay ── */
.modal-loading {
    position: fixed;
    inset: 0;
    z-index: 10006;
    background: #0a0510;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--rose);
    font-family: var(--font);
    transition: opacity 0.5s ease;
    pointer-events: none;
    opacity: 0;
}

.modal-loading.active {
    opacity: 1;
    pointer-events: auto;
}

.loading-heart {
    font-size: 3rem;
    animation: loading-pulse 1.2s infinite ease-in-out;
    margin-bottom: 16px;
    display: inline-block;
}

@keyframes loading-pulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.2); opacity: 1; filter: drop-shadow(0 0 15px var(--pink)); }
}

.modal-loading p {
    font-size: 1.1rem;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(255, 107, 157, 0.4);
    direction: rtl;
}
