/* ======================================= */
/*    TELJES, RESZPONZIVITÁSRA OPTIMALIZÁLT CSS KÓD     */
/* ======================================= */

@font-face {
    font-family: 'Breathing';
    src: url('fonts/Breathing.ttf') format('truetype');
}
@font-face {
    font-family: 'Brittany';
    src: url('fonts/Brittany.otf') format('opentype');
}
@font-face {
    font-family: 'HighSpirited';
    src: url('fonts/HighSpirited.ttf') format('truetype');
}
@font-face {
    font-family: 'TuesdayNight';
    src: url('fonts/TuesdayNight.otf') format('opentype');
}
@font-face {
    font-family: 'Amsterdam';
    src: url('fonts/Amsterdam.ttf') format('truetype');
} 

/* Alapok és a 3D Tér */
body {
    font-family: 'Special Elite', cursive;
    margin: 0;
    overflow: hidden;
    background-color: #3d2f23;
}

#scene {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 2500px;
}

:root {
    --folder-width: 700px;
}

#folder {
    width: 90vw; 
    max-width: var(--folder-width);
    height: 700px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 1.5s ease-in-out, max-width 0.5s ease-in-out;
}

#folder.open {
    transform: translateX(calc(var(--folder-width) / 2));
}

/* AKTA BORÍTÓ */
#folder-cover {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #c0a783;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(110, 89, 64, 0.6) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 75%, rgba(110, 89, 64, 0.7) 0%, transparent 60%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.15) 0%, transparent 40%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Cpath fill='%239C92AC' fill-opacity='0.1' d='M1 3h1v1H1V3zm2-2h1v1H3V1z'%3E%3C/path%3E%3C/svg%3E");
    border: 1px solid #4a3a2a;
    border-radius: 5px;
    box-shadow: 2px 2px 15px rgba(0,0,0,0.4);
    cursor: pointer;
    transform-origin: left;
    transition: transform 1.5s ease-in-out, z-index 0.1s 1.4s;
    transform-style: preserve-3d;
    z-index: 20;
}

#folder.open #folder-cover {
    transform: rotateY(-180deg);
    z-index: 10;
}

.cover-stain { position: absolute; top: 250px; left: 180px; transform: rotate(-15deg); opacity: 0.7; z-index: 15; }
.cover-stain img { width: 240px; height: 240px; object-fit: contain; filter: sepia(60%) saturate(1.8) brightness(0.35) hue-rotate(-10deg) contrast(1.3); }
.page-stain { position: absolute; bottom: 20px; right: 30px; transform: rotate(12deg); opacity: 0.6; z-index: 5; }
.page-stain img { width: 180px; height: 180px; object-fit: contain; filter: sepia(40%) saturate(1.5) brightness(0.4) hue-rotate(-5deg) contrast(1.2); }
.stamp-cover, .string-tie { position: absolute; }
.stamp-cover { top: 60px; right: 50px; font-size: 1.8rem; color: #b30000; border: 4px solid #b30000; padding: 8px 15px; text-transform: uppercase; transform: rotate(7deg); opacity: 0.9; }
.stamp-comment { position: absolute; top: 130px; right: 10px; font-family: 'HighSpirited', cursive; font-size: 2rem; color: #070244; transform: rotate(5deg); width: 150px; text-align: center; }

#cover-details { position: absolute; top: 200px; left: 80px; right: 80px; color: #3b2f2f; }
.detail-item { margin-bottom: 25px; border-bottom: 1px solid rgba(59, 47, 47, 0.3); padding-bottom: 5px; }
.detail-label { font-size: 0.9rem; opacity: 0.7; display: block; }
.detail-value { font-size: 1.1rem; padding-left: 10px; }
.detail-item:nth-child(2) .detail-value { font-weight: bold; text-align: center; padding-left: 0; padding-right: 25px; box-sizing: border-box; }
.honorific { font-family: 'TuesdayNight', cursive; font-size: 1.9rem; color: #8B0000; margin-right: 5px; transform: rotate(-3deg); display: inline-block; }

.string-tie { left: 30px; top: 30px; bottom: 30px; width: 8px; background-image: linear-gradient(to right, #706b62, #948f83, #706b62); border-radius: 5px; box-shadow: inset 1px 1px 2px rgba(0,0,0,0.4); }
.string-tie::before, .string-tie::after { content: ''; position: absolute; left: -6px; width: 20px; height: 20px; background: #c5c5c5; border-radius: 50%; border: 1px solid #333; box-shadow: inset 0 0 4px rgba(0,0,0,0.6), 1px 1px 2px rgba(0,0,0,0.3); }
.string-tie::before { top: -15px; }
.string-tie::after { bottom: -15px; }

#cover-footer { position: absolute; bottom: 40px; left: 80px; right: 80px; color: #3b2f2f; }
.footer-item { display: flex; align-items: flex-end; margin-bottom: 5px; }
.footer-label { font-size: 0.9rem; opacity: 0.8; min-width: 80px; }
.footer-value { font-size: 1.4rem; transform: rotate(-2deg); }
.footer-value.high-spirited { font-family: 'HighSpirited', cursive; font-size: 1.8rem; font-weight: bold; }
.footer-value.breathing { font-family: 'Breathing', cursive; line-height: 1; }
.footer-signature { height: 50px; transform: rotate(-3deg); filter: brightness(0.2); margin-left: 5px; }
.footer-item.seen-it { align-items: center; }
.seen-it-signature { height: 45px; filter: brightness(0.1); transform: rotate(4deg); margin-left: 5px; }

.cover-back { position: absolute; top:0; left: 0; width: 100%; height: 100%; background-color: #a9916b; box-shadow: inset 0 0 35px rgba(0,0,0,0.5); border: 1px solid #7c6a4d; transform: rotateY(180deg); backface-visibility: hidden; }
.photo-container { position: absolute; top: 30px; left: 30px; transform: rotate(-8deg); z-index: 5; }
.photo-container img { width: 150px; height: 150px; object-fit: cover; background-color: #fff; padding: 10px 10px 30px 10px; box-shadow: 2px 2px 8px rgba(0,0,0,0.3); background-image: radial-gradient(ellipse at 50% -10%, rgba(139, 69, 19, 0.3) 30%, transparent 70%); }
.photo-container::after { content: "H.G. fenykepe"; position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; font-size: 0.8rem; }
.photo-container::before { content: ''; position: absolute; top: -15px; left: -10px; width: 30px; height: 70px; border-radius: 15px; border: 5px solid #a97e6d; box-shadow: inset 1px 1px 3px rgba(139, 69, 19, 0.7); transform: rotate(20deg); }
.photo-signature-block { position: absolute; bottom: 50px; left: 50%; transform: translateX(-50%); text-align: justify; z-index: 6; width: 80%; }
.photo-signature-text { font-family: 'Breathing', cursive; font-size: 1rem; color: #222; margin-bottom: -10px; }
.photo-signature-image { width: 100px; height: 50px; object-fit: contain; filter: brightness(0.2); }

#folder-content { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: #a9916b; box-shadow: inset 0 0 25px rgba(0,0,0,0.4); border: 1px solid #7c6a4d; padding: 20px; box-sizing: border-box; z-index: 10; }
#folder.open #folder-content { z-index: 15; }

.page-stack { position: relative; width: 100%; height: 100%; perspective: 3000px; }
.page { position: absolute; top: 0; left: 0; width: 100%; height: 100%; transform-origin: left center; transition: transform 1.2s ease-in-out; transform-style: preserve-3d; }
#p1 { z-index: 4; } #p2 { z-index: 3; } #p3 { z-index: 2; } #p4 { z-index: 1; }
.page.flipped { transform: rotateY(-180deg); }

.page-face {
    position: absolute; width: 100%; height: 100%;
    backface-visibility: hidden; background-color: #f3eacb;
    background-image:
        radial-gradient(circle at 80% 25%, rgba(132, 94, 76, 0.4) 0%, rgba(132, 94, 76, 0.4) 20%, transparent 60%),
        radial-gradient(ellipse at 10% 90%, rgba(180, 160, 130, 0.5) 0%, transparent 50%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Cpath fill='%239C92AC' fill-opacity='0.1' d='M1 3h1v1H1V3zm2-2h1v1H3V1z'%3E%3C/path%3E%3C/svg%3E");
    box-shadow: inset 0 0 20px rgba(0,0,0,0.15); border: 1px solid #c9b7a1;
    padding: 30px; box-sizing: border-box; color: #333;
}
.page-face.back { transform: rotateY(180deg); }

.report-text p { text-align: justify; margin-bottom: 1em; line-height: 1.6; }

#page-controls {
    position: absolute;
    bottom: 25px;
    left: 30px;
    right: 30px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    z-index: 100;
}

#page-controls button {
    font-family: 'Special Elite', cursive;
    font-size: 1.2rem;
    padding: 10px 20px;
    background-color: #4a3a2a;
    color: #c9b7a1;
    border: 2px solid #c9b7a1;
    border-radius: 5px;
    cursor: pointer;
    transition: opacity 0.3s;
}

#page-controls button.hidden {
    opacity: 0;
    pointer-events: none;
}

.page-title { text-align: center; text-decoration: underline; font-size: 1.5rem; margin-top:0; padding-top: 10px;}
table { width: 100%; margin-top: 20px; border-collapse: collapse; }
td { padding: 10px 8px; border-bottom: 1px dashed rgba(0,0,0,0.2); transform: rotate(-0.2deg); }
tr:first-child td { border-top: 1px dashed rgba(0,0,0,0.2); }
td:first-child { transform: rotate(0.3deg); padding-left: 5px;}
.special-cell { padding-top: 20px !important; }

.handwritten { font-size: 0.9em; line-height: 1.6; }
.case-file { border: 1px dashed #888; padding: 15px; margin-top: 20px; background: rgba(0,0,0,0.02); }
.hidden { display: none !important; }

#countdown-container { text-align: center; margin-top: 10px; }
.countdown-box { margin-bottom: 15px; }
.countdown-box h4 { text-align: justify; line-height: 1.4; font-size: 0.9rem;}

.timer-grid { display: flex; justify-content: space-around; margin-top: 15px; flex-wrap: wrap; gap: 10px; }
.timer-unit { display: flex; flex-direction: column; align-items: center; background: rgba(0,0,0,0.05); padding: 10px; border-radius: 5px; min-width: 80px; flex-grow: 1; }
.timer-unit span { font-size: 2.5rem; color: #b30000; font-weight: bold; }
.timer-unit label { font-size: 0.8rem; margin-top: -5px; color: #555; }

.countdown-timer { font-size: 2.2rem; color: #b30000; font-weight: bold; }
#deserted-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(243, 234, 203, 0.8); display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 20px; box-sizing: border-box; }
.stamp-deserted { position: relative; font-size: 4rem; text-align:center; color: #d90429; border: 10px solid #d90429; transform: rotate(-10deg); }
.farewell { margin-top: 30px; font-size: 1.2rem; color: #2b2b2b; text-align: center; }


/* ======================================================= */
/* ---               RESZPONZÍV SZABÁLYOK              --- */
/* ======================================================= */

@media (max-width: 900px) {
    .page {
        transform-origin: top center;
    }
    .page.flipped {
        transform: rotateX(-180deg);
    }
    
    #folder.open {
        transform: translateX(45vw);
    }
    
    #cover-details, #cover-footer {
        left: 12%; 
        right: 12%;
    }

    #cover-details { top: 180px; }
    .detail-item { margin-bottom: 20px; }
    #cover-footer { bottom: 30px; }
}

@media (max-width: 550px) {
    #folder {
        height: 650px;
    }

    .page-face {
        padding: 25px 20px;
    }

    .page-title { font-size: 1.3rem; }
    .countdown-box h4 { font-size: 0.85rem; }

    .stamp-cover { font-size: 1.2rem; padding: 5px 10px; top: 20px; right: 15px; }
    .stamp-comment { font-size: 1.6rem; top: 80px; width: 120px; right: 5px; }
    
    .detail-value { font-size: 1rem; }
    .honorific { font-size: 1.7rem; }
    
    .footer-label { font-size: 0.8rem; min-width: 60px; }
    .footer-value { font-size: 1.1rem; }
    .footer-value.high-spirited { font-size: 1.4rem; }
    .footer-signature { height: 40px; }
    .seen-it-signature { height: 35px; }

    .timer-unit span { font-size: 2rem; }
    .timer-unit { min-width: 65px; }
    .countdown-timer { font-size: 1.8rem; }
    .stamp-deserted { font-size: 2.5rem; }
    .farewell { font-size: 1rem; }

    #page-controls button { font-size: 1rem; padding: 8px 15px; }
    #page-controls { bottom: 15px; left: 15px; right: 15px; }

    .photo-container { transform: rotate(-5deg); top: 15px; left: 15px; }
    .photo-container img { width: 120px; height: 120px; }
    .photo-signature-text { font-size: 0.9rem; }
}

@media (max-width: 420px) {
    #scene {
        overflow-x: auto; 
    }

    #folder {
        height: 85vh;
        min-height: 580px;
    }

    #folder.open {
        transform: translateX(40vw); 
    }

    .page-face {
        overflow-y: auto;
        padding: 20px 15px; 
    }
    
    .page-title { font-size: 1.2rem; }
    .countdown-box h4 { font-size: 0.8rem; line-height: 1.3; }
    
    .honorific { font-size: 1.5rem; }
    .footer-value { font-size: 1rem; }
    .footer-value.high-spirited { font-size: 1.2rem; }

    .timer-unit span { font-size: 1.8rem; }
    .timer-unit { min-width: 60px; padding: 5px; }
    .countdown-timer { font-size: 1.6rem; }
    .stamp-deserted { font-size: 2rem; border-width: 5px; }

    .photo-container img { width: 100px; height: 100px; }
    .photo-container { top: 10px; left: 10px; }
    
    #page-controls button { 
        font-size: 0.9rem; padding: 6px 12px; 
    }
    #page-controls { bottom: 10px; right: 10px; left: 10px; }
}

/* ========================================================== */
/* ÚJ RÉSZ: MÉDIA LEKÉRDEZÉSEK NAGYOBB KÉPERNYŐKHÖZ (JAVÍTVA)  */
/* ========================================================== */

/* VÁLTOZTATÁS: Töréspont 1600px-ről 1400px-re csökkentve, hogy a 125%-ra nagyított képernyőket is elérje. */
/* Nagyobb laptopok és standard desktop monitorok (pl. 22" 125%-os nagyítással) */
@media (min-width: 1400px) {
    :root {
        --folder-width: 900px;
    }
    #folder {
        height: 800px;
    }
}

/* VÁLTOZTATÁS: Töréspont 2000px-ről 1921px-re csökkentve, hogy a 100%-os Full HD monitorokat és a nagyobbakat is elérje. */
/* Nagy desktop monitorok (pl. 24"+ vagy 4K) */
@media (min-width: 1921px) {
    :root {
        --folder-width: 1100px;
    }
    #folder {
        height: 850px;
    }
}