/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --soft-pink: #FDF2F8;
    --pink-200: #FBCFE8;
    --pink-300: #F9A8D4;
    --pink-400: #F472B6;
    --pink-500: #EC4899;
    --lavender-100: #F3E8FF;
    --mint-100: #ECFDF5;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
}

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: linear-gradient(135deg, var(--soft-pink) 0%, var(--lavender-100) 50%, var(--mint-100) 100%);
    color: var(--gray-800);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Emojis */
#emoji-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.emoji-float {
    position: absolute;
    font-size: 20px;
    opacity: 0.3;
    animation: floatUp 15s infinite linear;
    pointer-events: none;
}

@keyframes floatUp {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0.3;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.2;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Container */
.container {
    max-width: 400px;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
    z-index: 2;
}

/* Header */
.header {
    text-align: center;
    padding: 0.75rem 0 0.5rem;
}

.title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.75rem, 6vw, 2.5rem);
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.heart {
    background: linear-gradient(135deg, var(--pink-500), var(--pink-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.subtitle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.subtitle h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1rem, 3.5vw, 1.5rem);
    color: var(--gray-700);
}

.heart-icon {
    font-size: 1.5rem;
    animation: heartbeat 1.5s ease-in-out infinite;
}

.tagline {
    font-size: clamp(0.875rem, 2.5vw, 1rem);
    color: var(--gray-600);
    font-weight: 400;
}

/* Countdown Section */
.countdown-section {
    padding: 0.5rem 0;
}

.countdown-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

@media (min-width: 768px) {
    .countdown-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

.countdown-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 1rem 0.75rem;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.countdown-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.countdown-digit {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 700;
    color: var(--gray-800);
    font-variant-numeric: tabular-nums;
    margin-bottom: 0.25rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    perspective: 1000px;
}

.digit-flip {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.digit-flip.flipping {
    transform: rotateX(-90deg);
}

.digit-flip.flipping .digit-front,
.digit-flip.flipping .digit-back {
    box-shadow: 0 6px 12px rgba(244, 114, 182, 0.3), 0 4px 8px rgba(0, 0, 0, 0.15);
}

.digit-front,
.digit-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.95));
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.4);
    font-weight: 700;
    color: var(--gray-800);
    font-variant-numeric: tabular-nums;
}

.digit-back {
    transform: rotateX(90deg);
}

.countdown-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Progress Section */
.progress-section {
    padding: 0.5rem 0;
}

.progress-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    margin: 0 auto;
}

.progress-card h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.25rem, 3.5vw, 1.75rem);
    color: var(--gray-800);
    margin-bottom: 1rem;
}

.progress-circle {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 1rem;
}

.progress-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-bg {
    fill: none;
    stroke: var(--gray-200);
    stroke-width: 6;
}

.progress-fill {
    fill: none;
    stroke: url(#gradient);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 0 251.2;
    transition: stroke-dasharray 1.5s ease-in-out;
}

.progress-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.progress-percent {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-800);
}

.progress-days {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
}

.progress-text {
    font-size: 1rem;
    color: var(--gray-600);
    line-height: 1.5;
}

/* Love Section */
.love-section {
    padding: 0.5rem 0;
}

.love-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.love-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.love-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.love-header h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.25rem, 3.5vw, 1.75rem);
    color: var(--gray-800);
}

.envelope {
    font-size: 1.5rem;
    opacity: 0.6;
}

.love-content {
    text-align: left;
    margin-bottom: 1rem;
}

.love-content p {
    font-size: 0.9rem;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.love-quote {
    background: var(--pink-50);
    border: 1px solid var(--pink-200);
    border-radius: 12px;
    padding: 0.75rem;
    margin-top: 0.75rem;
}

.love-quote p {
    font-style: italic;
    color: var(--gray-700);
    margin: 0;
}

.surprise-hint {
    background: linear-gradient(135deg, var(--pink-100), var(--pink-200));
    border: 1px solid var(--pink-300);
    border-radius: 12px;
    padding: 0.75rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.surprise-hint p {
    font-size: 0.875rem;
    color: var(--pink-600);
    font-weight: 500;
    margin: 0;
}

/* Footer */
.footer {
    text-align: center;
    padding: 0.75rem 0;
}

.footer-main {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.footer-sub {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 1rem;
}

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

.modal {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    padding: 1.5rem;
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-400);
    cursor: pointer;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--gray-600);
}

.modal-content {
    text-align: center;
    padding-top: 1rem;
}

.modal-emoji {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: rotate 2s infinite;
}

@keyframes rotate {
    0%, 100% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(10deg) scale(1.1); }
}

.modal-content h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    color: var(--gray-800);
    margin-bottom: 1rem;
}

.modal-text {
    text-align: left;
    font-size: 0.875rem;
    color: var(--gray-700);
    line-height: 1.6;
}

.modal-greeting {
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.modal-text p {
    margin-bottom: 0.75rem;
}

.modal-quote {
    background: var(--pink-50);
    border: 1px solid var(--pink-200);
    border-radius: 12px;
    padding: 0.75rem;
    margin: 1rem 0;
}

.modal-quote p {
    font-weight: 500;
    color: var(--pink-600);
    margin: 0;
}

.modal-signature {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-align: center;
    margin-top: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .countdown-card {
        padding: 0.5rem 0.25rem;
        min-height: 70px;
    }
    
    .progress-card,
    .love-card {
        padding: 0.75rem;
    }
    
    .modal {
        padding: 0.75rem;
        margin: 0.25rem;
        max-width: 95vw;
    }
    
    .progress-circle {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.25rem;
    }
    
    .countdown-grid {
        gap: 0.25rem;
        padding: 0;
    }
    
    .countdown-card {
        padding: 0.5rem 0.25rem;
        min-height: 65px;
    }
    
    .countdown-digit {
        font-size: clamp(1.25rem, 4vw, 1.75rem);
        height: 1.75rem;
    }
    
    .countdown-label {
        font-size: 0.7rem;
    }
    
    .progress-card,
    .love-card {
        padding: 0.5rem;
    }
    
    .progress-circle {
        width: 90px;
        height: 90px;
    }
    
    .modal {
        padding: 0.5rem;
        margin: 0.125rem;
        max-width: 98vw;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .heart,
    .heart-icon,
    .emoji-float,
    .modal-emoji {
        animation: none;
    }
    
    .surprise-hint {
        animation: none;
    }
    
    * {
        transition-duration: 0.01ms !important;
    }
}