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

:root {
    --bg-color: #FBF8F1; 
    --text-color: #312E2B;
    --primary-color: #529B88; /* Teal */
    --primary-hover: #438171;
    --secondary-color: #F1EAD7; 
    --accent-color: #EDB243; /* Mustard Yellow */
    --coral-color: #F05E7D; /* Pink/Coral */
    
    /* Tags colors */
    --color-montessori: #529B88;
    --color-otoriter: #F05E7D;
    --color-serbest: #EDB243;
    --color-celdirici: #F08E5E; 

    /* Pop-up backgrounds */
    --bg-montessori: #EAF3F0;
    --bg-otoriter: #FDEEF1;
    --bg-serbest: #FDF5E8;
    --bg-celdirici: #FDEFE8;

    --font-main: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

#app-container {
    width: 100%; max-width: 480px; padding: 2rem 1.5rem 8rem 1.5rem; 
    position: relative; display: flex; flex-direction: column;
}

/* Header & Top Bar */
header { text-align: center; margin-bottom: 2rem; }
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.logo-area h1 { font-size: 2.2rem; color: var(--coral-color); font-weight: 700; letter-spacing: 0.5px; }

.header-icons { display: flex; gap: 0.8rem; align-items: center; position: relative; }

.icon-btn {
    background-color: #FFF; border: none; border-radius: 50%;
    width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 1.3rem; transition: all 0.3s ease-in-out;
    box-shadow: 0 8px 15px rgba(0,0,0,0.06);
}
.icon-btn:hover { transform: translateY(-3px); box-shadow: 0 12px 20px rgba(0,0,0,0.08); }

/* Language Menu */
.lang-dropdown { position: relative; }
.lang-menu {
    position: absolute; top: 55px; right: 0; background: #FFF; border: none;
    border-radius: 24px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); z-index: 100;
    display: flex; flex-direction: column; min-width: 150px; max-height: 300px; overflow-y: auto;
    animation: slideUp 0.3s ease-in-out; padding: 0.5rem 0;
}
.lang-menu button {
    padding: 0.8rem 1.2rem; border: none; background: none; text-align: left; cursor: pointer;
    font-family: inherit; font-size: 1.1rem; transition: background 0.2s; font-weight: 500;
}
.lang-menu button:hover { background-color: var(--secondary-color); color: var(--primary-color); }
.flag-icon { margin-right: 8px; font-size: 1.2rem; }

header p { font-size: 1.2rem; color: #7A7671; text-align: left; font-weight: 600; }

/* Header Quote */
.header-quote {
    margin: 1rem 0 0.5rem 0;
    padding: 0.9rem 1.2rem;
    background-color: #FFFFFF;
    border-radius: 24px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.03);
    border-left: 5px solid var(--accent-color);
    text-align: left;
}
.quote-text {
    font-size: 1.05rem !important;
    font-style: italic;
    color: var(--text-color) !important;
    line-height: 1.5;
    margin-bottom: 0.3rem;
}
.quote-author {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    color: var(--primary-color) !important;
    text-align: right !important;
}

/* Day Navigation */
.day-nav {
    display: flex; align-items: center; justify-content: center; gap: 1.5rem;
    margin-top: 1.5rem; padding: 0.6rem 1rem; background-color: #FFF; border-radius: 40px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.04);
}
.nav-btn {
    background-color: var(--secondary-color); color: var(--text-color); border: none; border-radius: 50%;
    width: 40px; height: 40px; font-size: 1.3rem; font-weight: bold; cursor: pointer;
    display: flex; align-items: center; justify-content: center; transition: all 0.3s ease-in-out;
}
.nav-btn:not(:disabled):hover { background-color: var(--primary-color); color: #FFF; transform: scale(1.1); }
.nav-btn:disabled { opacity: 0.5; cursor: not-allowed; }
#current-day-label { font-weight: 700; font-size: 1.4rem; color: var(--text-color); min-width: 70px; text-align: center; }

/* Countdown */
#countdown-container {
    text-align: center; background-color: #FFF; padding: 1.2rem; border-radius: 30px; 
    margin-bottom: 2rem; font-size: 1.2rem; box-shadow: 0 8px 20px rgba(0,0,0,0.03);
    animation: fadeIn 0.4s ease-in-out; border: 2px dashed var(--secondary-color);
}
#countdown-timer { display: block; font-size: 1.8rem; font-weight: 700; color: var(--primary-color); font-variant-numeric: tabular-nums; margin-top: 0.3rem;}

.hidden { display: none !important; }

/* Game Screen & Questions */
#game-screen { display: flex; flex-direction: column; }
#questions-container { display: flex; flex-direction: column; gap: 4rem; }

.question-block {
    display: flex; flex-direction: column; gap: 1rem;
    transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
    scroll-margin-top: 80px;
}

.image-container {
    width: 100%;
    background: transparent;
    background-color: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 4px;
    margin: 0 auto;
    scroll-margin-top: 80px;
}
.image-container img {
    width: 95%;
    max-width: 100%;
    height: auto;
    max-height: min(420px, 50vh);
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border: none;
    box-shadow: none;
    background: transparent;
}

.question-block h2 { font-size: 1.4rem; font-weight: 700; text-align: center; color: var(--text-color); line-height: 1.4; padding: 0 0.5rem; margin-top: 0.2rem; }

.options-container { display: flex; flex-direction: column; gap: 1.2rem; }

.option-btn {
    background-color: #FFFFFF; border: none; border-radius: 30px;
    padding: 1.2rem 1.5rem; font-size: 1.2rem; font-family: inherit; color: var(--text-color);
    cursor: pointer; transition: all 0.3s ease-in-out; text-align: left;
    box-shadow: 0 8px 20px rgba(0,0,0,0.04);
    display: flex; flex-direction: column; gap: 0.6rem;
}
.inner-voice { font-size: 1.1rem; font-style: italic; color: #888; border-bottom: 2px dashed var(--secondary-color); padding-bottom: 0.6rem; }
.action-text { font-weight: 700; font-size: 1.3rem; }

.option-btn:not(:disabled):hover { transform: translateY(-4px); box-shadow: 0 12px 25px rgba(0,0,0,0.08); background-color: #FAFAFA; }
.option-btn:disabled { cursor: not-allowed; }
.option-btn.faded { opacity: 0.4; box-shadow: none; }

.option-btn.correct { background-color: var(--color-montessori); color: white; box-shadow: 0 10px 25px rgba(82,155,136,0.3); }
.option-btn.correct .inner-voice { color: rgba(255,255,255,0.85); border-bottom-color: rgba(255,255,255,0.3); }

.option-btn.wrong { background-color: var(--color-otoriter); color: white; box-shadow: 0 10px 25px rgba(240,94,125,0.3); }
.option-btn.wrong .inner-voice { color: rgba(255,255,255,0.85); border-bottom-color: rgba(255,255,255,0.3); }

/* Bridge Popup */
#bridge-popup {
    position: fixed; bottom: 0; left: 0; width: 100%; padding: 2.5rem 2rem 3rem 2rem;
    border-top-left-radius: 40px; border-top-right-radius: 40px;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.08); z-index: 50;
    animation: slideUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.bridge-content { max-width: 480px; margin: 0 auto; text-align: center; display: flex; flex-direction: column; gap: 1.8rem; }
#bridge-text { font-size: 1.4rem; font-weight: 600; color: var(--text-color); line-height: 1.5; }

.btn-primary {
    background-color: var(--primary-color); color: white; border: none; border-radius: 50px; 
    padding: 1.2rem 2.5rem; font-size: 1.4rem; font-weight: 700; cursor: pointer;
    transition: all 0.3s ease-in-out; font-family: inherit; box-shadow: 0 10px 25px rgba(82,155,136,0.3);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 15px 30px rgba(82,155,136,0.4); }

.btn-secondary { margin-top: 1rem; width: 100%; border: none; background: transparent; text-decoration: underline; cursor: pointer; color: #7A7671; font-family: inherit; font-size: 1.3rem; font-weight: 600; }

/* Modals */
#modal-backdrop {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(251, 248, 241, 0.85); backdrop-filter: blur(5px); z-index: 200; 
    display: flex; align-items: center; justify-content: center; padding: 1rem;
    animation: fadeIn 0.4s ease-in-out;
}
.modal {
    background: white; border-radius: 40px; padding: 2.5rem 2rem; width: 100%; max-width: 420px; position: relative;
    max-height: 85vh; overflow-y: auto; box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    animation: slideUpModal 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal .close-btn { 
    position: absolute; top: 1.2rem; right: 1.5rem; background: var(--secondary-color); 
    border: none; border-radius: 50%; width: 36px; height: 36px; font-size: 1.2rem; 
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-color); transition: all 0.3s ease; 
}
.modal .close-btn:hover { background: var(--coral-color); color: white; transform: rotate(90deg); }
.modal h2 { color: var(--coral-color); margin-bottom: 1.5rem; font-size: 2rem; text-align: center; font-weight: 700; }

/* Onboarding */
#onboarding-img { width: 100%; border-radius: 24px; margin-bottom: 1.5rem; aspect-ratio: 4/3; object-fit: cover; box-shadow: 0 10px 20px rgba(0,0,0,0.05); }
#ui-onboard-text { font-size: 1.3rem; line-height: 1.5; margin-bottom: 2rem; text-align: center; color: var(--text-color); font-weight: 600; }

/* Stats Modal & Calendar */
.stats-section { margin-bottom: 2rem; background: var(--bg-color); padding: 1.5rem; border-radius: 30px; }
.stats-section h3 { font-size: 1.3rem; margin-bottom: 1rem; color: var(--text-color); text-align: center; font-weight: 700; }

.calendar-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.6rem; }
.calendar-day {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: white; border-radius: 16px; padding: 0.6rem; box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}
.calendar-day.empty { background: transparent; box-shadow: none; }
.day-num { font-weight: bold; color: #A09D98; font-size: 1rem; margin-bottom: 0.2rem; }
.day-face { font-size: 1.6rem; }

.chart-container { display: flex; justify-content: center; margin: 1.5rem 0; }
.donut-chart {
    width: 160px; height: 160px; border-radius: 50%; background: #EAEAEA;
    -webkit-mask: radial-gradient(circle, transparent 52%, black 53%);
    mask: radial-gradient(circle, transparent 52%, black 53%);
    transition: background 1s ease-in-out;
}
#reflex-message { font-size: 1.25rem; text-align: center; font-weight: 700; line-height: 1.5; }

/* Result Screen */
#result-screen { text-align: center; display: flex; flex-direction: column; gap: 2rem; animation: slideUp 0.6s ease-in-out; }
.result-card { background-color: white; padding: 3rem 2rem; border-radius: 40px; box-shadow: 0 15px 40px rgba(0,0,0,0.06); }
.result-card h2 { color: var(--primary-color); margin-bottom: 1.2rem; font-size: 2rem; font-weight: 700; }
#takeaway-text { font-size: 1.4rem; font-style: italic; color: var(--text-color); margin-bottom: 2.5rem; font-weight: 600;}
.stats { display: flex; justify-content: space-around; background-color: var(--bg-color); padding: 1.5rem; border-radius: 24px; font-weight: 700; font-size: 1.3rem;}
#share-btn { width: 100%; padding: 1.3rem; border-radius: 50px; font-size: 1.4rem; }

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(50px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUpModal { from { opacity: 0; transform: translateY(80px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
