/* ==== CSS Variables Setup ==== */
:root {
    /* New Light Theme Colors */
    --bg-color-main: #fdfaf6;
    --card-surface: rgba(255, 255, 255, 0.7);
    --card-border: rgba(255, 218, 185, 0.6);

    /* Her favorite color is light peach */
    --accent-peach: #ffdab9;
    --accent-peach-darker: #f5bca0;
    /* slightly darker for better text contrast if needed */
    --accent-peach-dim: rgba(255, 218, 185, 0.4);
    --accent-glow: 0 8px 30px rgba(255, 218, 185, 0.6);
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);

    --text-main: #2d2a26;
    --text-muted: #6b6763;
    --text-heading: #1a1816;

    --font-heading: 'Playfair Display', serif;
    --font-body: 'Outfit', sans-serif;

    --transition-snappy: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ==== Base Styles ==== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color-main);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Background gradient orb effect for light theme */
body::before {
    content: '';
    position: fixed;
    top: -10vw;
    right: -10vw;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, var(--accent-peach-dim) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
}

body::after {
    content: '';
    position: fixed;
    bottom: -15vw;
    left: -15vw;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(255, 235, 230, 0.5) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
}

/* ==== Emoji Lock Screen ==== */
.lock-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(253, 250, 246, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, visibility 0.8s;
}

.lock-screen.unlocked {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.lock-content {
    text-align: center;
    background: white;
    padding: 3rem 2rem;
    border-radius: 24px;
    box-shadow: var(--shadow-soft), var(--accent-glow);
    border: 1px solid var(--accent-peach-dim);
    max-width: 400px;
    width: 90%;
    transform: translateY(0) scale(1);
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lock-screen.unlocked .lock-content {
    transform: translateY(-50px) scale(1.1);
}

.lock-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
}

.lock-subtitle {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* Date Lock Form */
.date-lock-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 1rem;
}

.dob-input {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--accent-peach-dim);
    border-radius: 12px;
    font-size: 1.2rem;
    font-family: var(--font-body);
    color: var(--text-heading);
    background: #fff;
    outline: none;
    transition: var(--transition-snappy);
    text-align: center;
}

.dob-input:focus {
    border-color: var(--accent-peach-darker);
    box-shadow: 0 0 0 4px rgba(255, 218, 185, 0.4);
}

.unlock-btn {
    background: white;
    color: var(--accent-peach-darker);
    border: 2px solid var(--accent-peach-darker);
    border-radius: 12px;
    padding: 15px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-snappy);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.unlock-btn:hover {
    background: var(--accent-peach-darker);
    color: white;
    box-shadow: var(--shadow-soft);
}

.lock-error {
    color: #ff6b6b;
    font-size: 0.9rem;
    min-height: 20px;
    opacity: 0;
    transition: opacity 0.3s;
}

.lock-error.visible {
    opacity: 1;
}

/* ==== Typography & Header ==== */
header {
    text-align: center;
    padding: 4rem 1rem 2rem;
    position: relative;
    /* Hide scroll content initially */
    opacity: 0;
    transform: translateY(20px);
    transition: all 1s ease 0.5s;
}

.app-loaded header,
.app-loaded main {
    opacity: 1;
    transform: translateY(0);
}

main {
    flex: 1;
    padding: 2rem 1rem 6rem;
    display: flex;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 1s ease 0.7s;
}

.header-content h1 {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 600;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    color: var(--text-heading);
    display: inline-block;
}

.header-heart {
    color: var(--accent-peach-darker);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    margin-left: 10px;
    animation: pulse 2s infinite ease-in-out;
}

.header-content p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 500px;
    margin: 0 auto;
}

/* ==== Grid Container ==== */
.container {
    width: 100%;
    max-width: 1200px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* ==== Cards (Glassmorphism Light) ==== */
.card {
    background: var(--card-surface);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 1.8rem;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    transition: var(--transition-snappy);
    display: flex;
    flex-direction: column;
    justify-content: center;
    cursor: pointer;
    min-height: 180px;
    box-shadow: var(--shadow-soft);

    /* Animation initial states */
    opacity: 0;
    transform: translateY(20px);
    /* Note: JS triggers the animation after unlock */
}

.app-loaded .card {
    animation: fadeUp 0.6s forwards cubic-bezier(0.2, 0.8, 0.2, 1);
}

.card:hover {
    transform: translateY(-8px);
    border-color: var(--accent-peach-darker);
    box-shadow: 0 12px 30px rgba(255, 218, 185, 0.8);
    background: #ffffff;
}

.card-icon {
    position: absolute;
    top: -15px;
    right: -15px;
    font-size: 6rem;
    color: rgba(255, 218, 185, 0.2);
    transition: var(--transition-snappy);
    transform: rotate(-15deg);
    z-index: 0;
}

.card:hover .card-icon {
    color: rgba(255, 218, 185, 0.4);
    transform: rotate(0) scale(1.1);
}

.card-category {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-peach-darker);
    margin-bottom: 0.8rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.card-item {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    line-height: 1.3;
    font-weight: 500;
    color: var(--text-main);
    position: relative;
    z-index: 1;
}

.small-icon {
    margin-right: 6px;
}

/* ==== Floating Action Button ==== */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: var(--accent-peach-darker);
    color: white;
    font-size: 1.8rem;
    border: none;
    box-shadow: 0 8px 25px rgba(245, 188, 160, 0.6);
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-snappy);
    opacity: 0;
    transform: scale(0);
}

.app-loaded .fab {
    opacity: 1;
    transform: scale(1);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) 1.5s;
    /* Pop in smoothly after cards */
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
    background: #f0aa8a;
    box-shadow: 0 12px 30px rgba(245, 188, 160, 0.8);
}

/* ==== Modal (Light Theme) ==== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(253, 250, 246, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-snappy);
    padding: 1rem;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 450px;
    position: relative;
    transform: scale(0.95) translateY(20px);
    transition: var(--transition-snappy);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-btn:hover {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

.modal-content h2 {
    font-family: var(--font-heading);
    margin-bottom: 1.5rem;
    text-align: center;
    color: var(--text-heading);
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    background: #fdfaf6;
    border: 1.5px solid var(--card-border);
    border-radius: 12px;
    padding: 14px 15px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 1.05rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-peach-darker);
    box-shadow: 0 0 0 3px rgba(255, 218, 185, 0.3);
}

.input-group input::placeholder {
    color: #b0aca8;
}

/* Icon Selection Grid */
.icon-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
}

.icon-selector i {
    font-size: 1.3rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 12px;
    border-radius: 12px;
    border: 1.5px solid transparent;
    transition: var(--transition-snappy);
    width: 45px;
    text-align: center;
}

.icon-selector i:hover {
    background: #fcfcfc;
    color: var(--accent-peach-darker);
    border-color: var(--accent-peach-dim);
}

.icon-selector i.selected {
    color: white;
    border-color: var(--accent-peach-darker);
    background: var(--accent-peach-darker);
}

/* Form Submit button */
.submit-btn {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    background: var(--accent-peach-darker);
    color: white;
    border: none;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: var(--transition-snappy);
    margin-top: 1rem;
}

.submit-btn:hover {
    background: #f0aa8a;
    box-shadow: 0 8px 25px rgba(245, 188, 160, 0.5);
    transform: translateY(-2px);
}

/* ==== Animations ==== */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    50% {
        transform: translateX(5px);
    }

    75% {
        transform: translateX(-5px);
    }
}

/* Heart Rain Animation */
.heart-rain {
    position: fixed;
    top: -10%;
    z-index: 50;
    /* below FAB but above background */
    font-size: 1.5rem;
    user-select: none;
    pointer-events: none;
    animation: fall linear forwards;
}

@keyframes fall {
    to {
        transform: translateY(120vh) rotate(360deg);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
    }

    .fab {
        bottom: 20px;
        right: 20px;
        width: 60px;
        height: 60px;
    }

    .modal-content {
        padding: 2rem 1.5rem;
    }
}