@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=Caveat:wght@400;500;600;700&family=Newsreader:ital,wght@0,400;0,600;1,400&display=swap');

body { 
    font-family: 'Nunito', sans-serif; 
}

/* Smooth transitions for dark mode */
body, .theme-transition {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Paper texture for the letter */
#letter-card {
    /* Slight rotation to look placed on a desk */
    transform: rotate(-1deg);
    background-color: #FBF8F1;
    background-image: 
        linear-gradient(to right, rgba(0,0,0,0.02) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(0,0,0,0.02) 1px, transparent 1px),
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.08'/%3E%3C/svg%3E");
    background-size: 40px 40px, 40px 40px, 200px 200px;
}

/* Keep the paper light even in dark mode for realism */
.dark #letter-card {
    background-color: #FDFCF7;
    color: #1c1917;
}

.dark #letter-card .text-stone-800 { color: #1c1917 !important; }
.dark #letter-card .text-stone-700 { color: #44403c !important; }
.dark #letter-card .text-stone-500 { color: #78716c !important; }

/* Soft, realistic drop shadow */
.shadow-2xl {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Editable text styling */
.editable-text {
    cursor: text;
    transition: background-color 0.2s ease, outline 0.2s ease;
    border-radius: 8px;
    padding: 8px;
    margin: -8px; /* Offset padding so layout doesn't shift */
    outline: 1px dashed transparent;
}
.editable-text:hover {
    background-color: rgba(0, 0, 0, 0.03);
    outline: 1px dashed rgba(164, 36, 59, 0.2); /* maple-red opacity */
}
.editable-text:focus {
    background-color: rgba(0, 0, 0, 0.03);
    outline: 1px dashed rgba(164, 36, 59, 0.5);
    outline-offset: 4px;
}

/* Animations */
.fade-in { animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(10px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* Shake animation for invalid input */
.shake { animation: shake 0.4s ease-in-out; }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Fix for scrolling */
html, body { 
    min-height: 100%; 
    overflow-y: auto; 
}