@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400&family=Lora:ital@0;1&display=swap');

:root {
    --bg-color: #fdfbf7;
    --text-color: #2c2c2c;
    --accent-color: #8d6e63;
    --folder-border: rgba(141, 110, 99, 0.3);
    --input-border: #d1d5db;
}

/* Thèmes (pour index.html) */
.theme-rupture {
    --bg-color: #f0f4f8;
    --text-color: #1a202c;
    --accent-color: #4a5568;
    --folder-border: rgba(74, 85, 104, 0.3);
}

.theme-amour {
    --bg-color: #fff0f3;
    --text-color: #4a0404;
    --accent-color: #be123c;
    --folder-border: rgba(190, 18, 60, 0.3);
}

.theme-colere {
    --bg-color: #fff5f5;
    --text-color: #1a0505;
    --accent-color: #9b2c2c;
    --folder-border: rgba(155, 44, 44, 0.3);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    width: 100%;
    font-family: 'Lora', serif;
    background-color: var(--bg-color);
    color: var(--text-color);
}

/* Texture grain (mise en arrière-plan pour ne pas bloquer les clics) */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 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.05'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: -1;
    opacity: 0.05;
}

/* Note: z-index varied in original files (1 in index, 50 in depot, -1 in merci). 
   -1 is safest for background to avoid blocking clicks, but index used 1.
   Checking index.html styles: .intro-screen has z-index 10, so z-index 1 for BG is fine but unnecessary if it's just visual. 
   I'll stick to -1 to be safe and avoid blocking interactions. 
   Wait, depot used opacity 0.4 and z-index 50? 
   No, depot used z-index 50 and opacity 0.4. That seems like an overlay.
   Let's check index.html: opacity 0.05.
   Let's unify to opacity 0.05 generally, but depot might want it darker?
   Actually, depot.html has a .vignette overlay too.
   I'll keep the main body::before for the texture at a low z-index.
*/

/* --- Index Specifics --- */

.intro-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 10;
}

.main-title {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    margin-bottom: 10px;
}

.tagline {
    font-style: italic;
    color: var(--accent-color);
    margin-bottom: 40px;
}

.cta-container {
    display: flex;
    gap: 20px;
}

.cta-btn {
    padding: 15px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-family: 'Playfair Display', serif;
    transition: 0.3s;
    border: 1px solid var(--text-color);
    cursor: pointer;
}

.btn-primary {
    background: var(--text-color);
    color: white;
}

.btn-secondary {
    background: transparent;
    color: var(--text-color);
}

.letter-screen {
    min-height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 100px 20px;
    box-sizing: border-box;
    background-color: var(--bg-color);
    position: relative;
    z-index: 10;
}

.letter-container {
    max-width: 650px;
    width: 100%;
    border: 1px solid var(--folder-border);
    padding: 40px;
    background: rgba(255, 255, 255, 0.7);
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
}

.archive-tab {
    position: absolute;
    top: -31px;
    left: -1px;
    border: 1px solid var(--folder-border);
    border-bottom: none;
    padding: 6px 16px;
    font-family: 'Playfair Display';
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.7);
}

.letter-content-wrapper {
    position: relative;
    overflow: hidden;
    max-height: 5000px;
    transition: max-height 1s ease-in-out;
}

.letter-content-wrapper.collapsed {
    max-height: 400px;
}

.letter-content-wrapper.collapsed::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.9));
    pointer-events: none;
}

.highlight {
    color: var(--accent-color);
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1.35rem;
    border-left: 3px solid var(--accent-color);
    padding-left: 20px;
    margin: 40px 0;
    display: block;
    line-height: 1.5;
}

.signature {
    text-align: right;
    margin-top: 50px;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    color: var(--accent-color);
}

.recipient-mention {
    font-style: italic;
    opacity: 0.6;
    margin-bottom: 25px;
    font-size: 0.95rem;
    display: block;
}

.reaction-bar {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.reaction-btn {
    background: transparent;
    border: 1px solid var(--folder-border);
    border-radius: 20px;
    padding: 6px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    color: inherit;
    font-size: 0.9rem;
    transition: 0.2s;
}

.reaction-btn:hover {
    background: rgba(0, 0, 0, 0.03);
}

.reaction-btn.active {
    background-color: var(--accent-color) !important;
    color: #fff !important;
}

.read-more-btn {
    display: none;
    margin: 30px auto 0;
    padding: 12px 35px;
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    font-family: 'Playfair Display', serif;
    border-radius: 50px;
    cursor: pointer;
    position: relative;
    z-index: 20;
}

.collapsed+.read-more-btn {
    display: block;
}

.write-btn {
    position: fixed;
    top: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: #555;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Playfair Display', serif;
}

.feather-icon {
    width: 18px;
    height: 18px;
}

.filter-menu {
    margin-top: 60px;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    z-index: 100;
}

.filter-menu select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--folder-border);
    font-family: 'Playfair Display', serif;
    font-style: italic;
    padding: 10px 40px;
    border-radius: 30px;
    color: var(--accent-color);
    cursor: pointer;
    font-size: 0.95rem;
    transition: 0.3s;
    text-align: center;
    text-align-last: center;
    display: inline-block;
    width: auto;
    min-width: 280px;

    /* Flèche personnalisée centrée à droite */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238d6e63' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 20px center;
}

.filter-menu select:hover {
    border-color: var(--accent-color);
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* --- Depot Specifics --- */
.page-depot {
    display: flex;
    justify-content: center;
    min-height: 100dvh;
}

.page-depot::before {
    /* Override for depot to match original opacity if needed? 
       Original was 0.4. Let's make a specific class for it.
    */
    opacity: 0.4;
    z-index: 50;
    /* Original used 50... seems high */
}

.vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 50%, rgba(0, 0, 0, 0.05) 150%);
    pointer-events: none;
    z-index: 1;
}

.close-btn {
    position: fixed;
    top: 30px;
    left: 30px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 2rem;
    line-height: 1;
    transition: opacity 0.3s;
    z-index: 100;
    opacity: 0.6;
}

.close-btn:hover {
    opacity: 1;
}

.container-depot {
    width: 100%;
    max-width: 600px;
    padding: 80px 20px 40px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 60;
}

.input-group {
    margin-bottom: 30px;
    position: relative;
}

input[type="text"],
textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-family: 'Lora', serif;
    font-size: 1.2rem;
    outline: none;
    padding: 10px 0;
    resize: none;
}

.recipient-input {
    border-bottom: 1px solid var(--input-border);
    transition: border-color 0.3s;
}

.recipient-input:focus {
    border-bottom: 1px solid var(--accent-color);
}

::placeholder {
    color: var(--text-color);
    opacity: 0.4;
    font-style: italic;
}

.message-area {
    min-height: 300px;
    line-height: 1.6;
    font-size: 1.1rem;
}

.emotion-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 40px;
    justify-content: center;
}

.emotion-radio {
    display: none;
}

.emotion-label {
    padding: 8px 16px;
    border: 1px solid var(--input-border);
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Playfair Display', serif;
    opacity: 0.7;
    background: rgba(255, 255, 255, 0.5);
}

.emotion-label:hover {
    opacity: 1;
    border-color: #000;
}

input[value="Amour"]:checked+.emotion-label,
.emotion-label[for="amour"]:hover {
    background-color: #fff0f3;
    color: #9b2c2c;
    border-color: #9b2c2c;
    opacity: 1;
}

input[value="Rupture"]:checked+.emotion-label,
.emotion-label[for="rupture"]:hover {
    background-color: #f0f4f8;
    color: #2c5282;
    border-color: #2c5282;
    opacity: 1;
}

input[value="Colere"]:checked+.emotion-label,
.emotion-label[for="colere"]:hover {
    background-color: #fff5f5;
    color: #742a2a;
    border-color: #742a2a;
    opacity: 1;
}

input[value="Regret"]:checked+.emotion-label,
.emotion-label[for="regret"]:hover {
    background-color: #fdfbf7;
    color: #5d4037;
    border-color: #5d4037;
    opacity: 1;
}

input[value="Espoir"]:checked+.emotion-label,
.emotion-label[for="espoir"]:hover {
    background-color: #f0fff4;
    color: #276749;
    border-color: #276749;
    opacity: 1;
}

.submit-btn {
    background: transparent;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 15px 40px;
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    cursor: pointer;
    margin: 0 auto;
    display: block;
    transition: all 0.4s ease;
    letter-spacing: 1px;
    border-radius: 4px;
}

.submit-btn:hover {
    background: var(--text-color);
    color: var(--bg-color);
}

.disclaimer {
    margin-top: 30px;
    font-size: 0.8rem;
    color: var(--text-color);
    text-align: center;
    font-style: italic;
    opacity: 0.6;
}

/* --- Merci Specifics --- */
.page-merci {
    justify-content: center;
    align-items: center;
    text-align: center;
    flex-direction: column;
    display: flex;
    min-height: 100vh;
}

.page-merci::before {
    opacity: 0.4;
    /* Matches original merci opacity */
}

.merci-title {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-size: 2.5rem;
    color: #2c2c2c;
    margin-bottom: 20px;
    font-style: italic;
}

.merci-text {
    font-size: 1.2rem;
    color: #8d6e63;
    max-width: 500px;
    margin: 0 auto 50px;
    line-height: 1.6;
    padding: 0 20px;
}

.back-btn {
    text-decoration: none;
    border: 1px solid #2c2c2c;
    color: #2c2c2c;
    padding: 15px 40px;
    border-radius: 50px;
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    transition: all 0.4s ease;
    cursor: pointer;
    background: transparent;
}

.back-btn:hover {
    background-color: #2c2c2c;
    color: #fdfbf7;
}

.fade-in {
    animation: fadeIn 2s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* --- Social Footer --- */
.social-footer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.social-footer a {
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: 0.75rem;
    color: var(--text-color);
    text-decoration: none;
    opacity: 0.3;
    transition: opacity 0.3s ease;
    letter-spacing: 1px;
}

.social-footer a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

@media (max-width: 600px) {
    .social-footer {
        bottom: 10px;
        right: 10px;
    }
}

/* --- Trigger Warning / Archive Sensible --- */
.letter-container {
    position: relative;
    /* Ensure positioning context for overlay */
}

/* Flou appliqué au contenu */
.letter-content-wrapper.blurred {
    filter: blur(4px);
    /* Réduit à 4px */
    transition: filter 0.8s ease-out;
    user-select: none;
}

/* Overlay recouvrant la lettre */
.sensitive-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(253, 251, 247, 0.92);
    /* Opacité réduite à 92% */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    text-align: center;
    padding: 40px;
    /* Plus d'espace blanc */
    box-sizing: border-box;
    transition: opacity 0.8s ease-out, visibility 0.8s;
    border-radius: inherit;
}

/* État masqué de l'overlay */
.sensitive-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Le message (trigger type) */
.sensitive-message {
    font-family: 'Lora', serif;
    font-size: 1.1rem;
    color: var(--text-color);
    font-style: italic;
    opacity: 0.8;
    margin-bottom: 30px;
    max-width: 80%;
}

/* Le bouton (lien discret) */
.sensitive-btn {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--accent-color);
    color: var(--text-color);
    padding: 5px 0;
    font-family: 'Lora', serif;
    font-size: 0.95rem;
    font-style: italic;
    cursor: pointer;
    border-radius: 0;
    transition: all 0.3s ease;
}

.sensitive-btn:hover {
    background: transparent;
    border-bottom-width: 2px;
    /* Épaississement du soulignement */
    color: var(--text-color);
}

/* --- Support Link (Buy Me a Coffee) --- */
.support-link {
    display: block;
    text-align: center;
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: 0.9rem;
    color: var(--text-color);
    text-decoration: none;

    /* Hidden by default */
    opacity: 0;
    max-height: 0;
    margin-top: 0;
    overflow: hidden;
    pointer-events: none;

    /* Transition douce */
    transition: opacity 1.5s ease, max-height 1s ease, margin-top 1s ease;
}

.support-link.visible {
    opacity: 0.6;
    /* 60% opacity as requested initially */
    max-height: 100px;
    /* Suffisant pour le texte */
    margin-top: 25px;
    pointer-events: auto;
}

.support-link.visible:hover {
    opacity: 1;
    text-decoration: underline;
}

/* --- Charter Modal --- */
.charter-link {
    display: block;
    text-align: center;
    margin: 20px auto;
    font-family: 'Lora', serif;
    font-size: 0.9rem;
    color: var(--text-color);
    text-decoration: underline;
    opacity: 0.7;
    cursor: pointer;
}

.charter-link:hover {
    opacity: 1;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-content {
    background: var(--bg-color);
    /* #fdfbf7 */
    padding: 40px;
    max-width: 500px;
    width: 90%;
    border-radius: 4px;
    position: relative;
    font-family: 'Lora', serif;
    color: var(--text-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    line-height: 1.6;
}

.modal-content h2 {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    margin-top: 0;
    color: var(--accent-color);
    text-align: center;
}

.modal-content ul {
    list-style-type: disc;
    padding-left: 20px;
    margin: 20px 0;
}

.modal-content li {
    margin-bottom: 10px;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: var(--text-color);
    cursor: pointer;
    font-weight: 100;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.modal-close:hover {
    opacity: 1;
}