/* --- GLOBAL SETTINGS (APPLE LIGHT THEME) --- */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #F5F5F7;
    color: #1D1D1F;
    overflow: hidden;
    margin: 0;
    height: 100vh;
    cursor: none;
    user-select: none;
    perspective: 1000px;
    transition: background-color 0.5s;
}

/* --- RED MAGIC CURSOR --- */
.magic-cursor {
    position: fixed; width: 12px; height: 12px; 
    background-color: #FF3B30; border-radius: 50%;
    pointer-events: none; z-index: 10000;
    transform: translate(-50%, -50%); will-change: top, left; 
    box-shadow: 0 2px 10px rgba(255, 59, 48, 0.4);
}
.cursor-trail {
    position: fixed; width: 8px; height: 8px; 
    background-color: rgba(255, 59, 48, 0.4);
    border-radius: 50%; pointer-events: none; z-index: 9999;
    transform: translate(-50%, -50%); animation: fadeOutTrail 0.5s forwards;
}
/* --- ЕПИЧНА УДАРНА ВЪЛНА ПРИ КЛИК --- */
.cursor-ripple {
    position: fixed; 
    border: 4px solid #FF3B30; /* По-дебел контур */
    border-radius: 50%; 
    /* Двойно сияние: навън и навътре */
    box-shadow: 0 0 30px rgba(255, 59, 48, 0.8), inset 0 0 15px rgba(255, 59, 48, 0.5);
    pointer-events: none; 
    z-index: 9998; 
    transform: translate(-50%, -50%); 
    /* По-плавна и малко по-бавна анимация за драматизъм */
    animation: rippleExpand 0.7s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}
@keyframes rippleExpand { 
    0% { width: 0px; height: 0px; opacity: 1; border-width: 10px; } 
    100% { width: 500px; height: 500px; opacity: 0; border-width: 0px; } /* Огромна вълна! */
}
/* --- SHOCKWAVE --- */
.shockwave {
    position: fixed; 
    top: 50%; left: 50%; 
    transform: translate(-50%, -50%); 
    border-radius: 50%; 
    background: transparent;
    border: 20px solid #FF3B30; 
    box-shadow: 0 0 50px rgba(255, 59, 48, 0.5);
    z-index: 2000; 
    pointer-events: none; 
    animation: shockwave-expand 0.7s ease-out forwards;
}
@keyframes shockwave-expand { 
    0% { width: 0; height: 0; opacity: 1; border-width: 40px; } 
    100% { width: 150vw; height: 150vw; opacity: 0; border-width: 0; } 
}
.shake-screen { animation: screen-shake 0.5s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes screen-shake { 
    10%, 90% { transform: translate3d(-3px, 0, 0); } 
    20%, 80% { transform: translate3d(6px, 0, 0); } 
    30%, 50%, 70% { transform: translate3d(-8px, 0, 0); } 
    40%, 60% { transform: translate3d(8px, 0, 0); } 
}

/* --- TENSE COLORS (ENFORCED WITH !IMPORTANT) --- */
.tense-present { color: #008f5d !important; font-weight: 700; background: rgba(0, 255, 163, 0.15); padding: 4px 12px; border-radius: 99px; }
.tense-past { color: #c45f00 !important; font-weight: 700; background: rgba(255, 158, 0, 0.15); padding: 4px 12px; border-radius: 99px; }
.tense-future { color: #007AFF !important; font-weight: 700; background: rgba(0, 122, 255, 0.1); padding: 4px 12px; border-radius: 99px; }
.tense-continuous { color: #AF52DE !important; font-weight: 700; background: rgba(175, 82, 222, 0.1); padding: 4px 12px; border-radius: 99px; }
.tense-perfect { color: #B38600 !important; font-weight: 900; background: rgba(255, 215, 0, 0.2); padding: 4px 12px; border-radius: 99px; }

/* --- TEXT REVEAL (PURE FADE) --- */
.word-wrapper { display: inline-block; white-space: nowrap; margin-right: 0.25em; }
.char-reveal { 
    display: inline-block; 
    opacity: 0; 
    transform: none; 
    transition: opacity 0.5s ease-out; 
    will-change: opacity; 
    color: inherit; 
}
.char-reveal.in { opacity: 1; }

/* --- SLIDE CONTAINER --- */
.slide { 
    position: absolute; inset: 0; 
    transition: opacity 0.6s ease-in-out;
    pointer-events: none; 
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    will-change: opacity;
    overflow: hidden;
    background-color: #F5F5F7; 
    z-index: 1;
}

.slide.active { opacity: 1; pointer-events: all; z-index: 10; }

.slide.exit {
    opacity: 1 !important;
    z-index: 5 !important;
    pointer-events: none;
    display: flex !important;
}

.emoji-hero { font-size: 4rem; margin-bottom: 1rem; animation: pulse 3s infinite; filter: drop-shadow(0 10px 20px rgba(0,0,0,0.15)); }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

/* --- BACKGROUND IMAGE --- */
.split-slide { display: block; position: absolute; inset: 0; }

.slide-image-container {
    position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; overflow: hidden;
    background-color: #000;
}

.slide-image {
    width: 100%; height: 100%; 
    object-fit: contain; 
    opacity: 0; 
    transform: scale(1.05);
    transition: opacity 0.8s ease-in-out, transform 15s linear;
}

.slide.active .slide-image { opacity: 1; transform: scale(1); }
.slide.exit .slide-image { opacity: 1; } 

/* --- CONTENT OVERLAY --- */
.slide-content-container {
    position: absolute; inset: 0; z-index: 10;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    pointer-events: none;
    opacity: 1; 
}

/* THE CONTENT CARD */
.content-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    border-radius: 40px;
    padding: 3rem 5rem;
    text-align: center;
    max-width: 1400px;
    width: 95%;
    pointer-events: auto;
    opacity: 1;
    transform: none;
    transition: none;
}

body.text-hidden .content-card {
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease !important;
}

.content-card h1, .content-card .qa-answer-text { text-shadow: 0 4px 10px rgba(0,0,0,0.1); color: #1D1D1F; }

#hidden-text-indicator {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.6); color: white; padding: 8px 20px; border-radius: 30px;
    font-size: 0.9rem; font-weight: 600; pointer-events: none; opacity: 0; transition: opacity 0.3s;
    z-index: 2000; backdrop-filter: blur(5px);
}
body.text-hidden #hidden-text-indicator { opacity: 1; }

/* --- GLASS PANEL --- */
.glass-panel { 
    background: rgba(255, 255, 255, 0.7); 
    backdrop-filter: blur(20px); border: 1px solid rgba(0, 0, 0, 0.05); 
    border-radius: 20px; opacity: 0; transform: scale(0.98); 
    transition: opacity 0.4s ease, transform 0.4s ease; box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.glass-panel.revealed { opacity: 1; transform: scale(1); }
.glass-panel.clickable:hover { 
    background: rgba(255,255,255,0.95); border-color: rgba(0,0,0,0.1); 
    transform: scale(1.02); box-shadow: 0 15px 30px rgba(0,0,0,0.12); cursor: none; 
}

/* OVERRIDE COLORS */
.text-white { color: #1D1D1F !important; }
.text-gray-400 { color: #86868b !important; }
.text-purple-300 { color: #AF52DE !important; }
.text-yellow-300 { color: #FF9500 !important; }
.text-blue-300 { color: #007AFF !important; }
.text-red-500 { color: #FF3B30 !important; }
.text-5xl, .text-7xl { color: #1D1D1F !important; text-shadow: none !important; }

.reaction-container { text-align: center; }
.reaction-text { font-size: 6rem; font-weight: 900; line-height: 1; background: linear-gradient(135deg, #FF3B30 0%, #FF9500 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; animation: text-vibrate 0.8s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes text-vibrate { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

/* Q&A STYLES */
.qa-container { width: 100%; max-width: 1400px; position: relative; }
.qa-label { display: inline-block; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; padding: 0.6rem 2rem; border-radius: 50px; background: rgba(0, 0, 0, 0.05); border: 1px solid rgba(0, 0, 0, 0.05); color: #86868b; backdrop-filter: blur(10px); }

/* QUESTION COLOR */
.qa-question-text { 
    font-size: 4.5rem; font-weight: 800; margin-bottom: 2rem; 
    color: #5AC5DB !important; 
    line-height: 1.1; letter-spacing: -0.02em; 
    text-shadow: 0 4px 15px rgba(90, 197, 219, 0.3);
}
.qa-question-text .char-reveal { color: #5AC5DB !important; }

.qa-answer-box { background: transparent; border: none; display: block; margin-top: 1rem; width: 100%; }
.qa-answer-text { font-size: 5rem; font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; }
.qa-context-text { font-size: 1.8rem; color: #86868b; margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }

.theme-yes .qa-answer-text { color: #34C759; }
.theme-no .qa-answer-text { color: #FF3B30; }
.theme-choice .qa-answer-text { color: #007AFF; }
.theme-wh .qa-answer-text { color: #AF52DE; }

.theme-yes .content-card { border-color: rgba(52, 199, 89, 0.3); box-shadow: 0 20px 60px rgba(52, 199, 89, 0.15); }
.theme-no .content-card { border-color: rgba(255, 59, 48, 0.3); box-shadow: 0 20px 60px rgba(255, 59, 48, 0.15); }
.theme-choice .content-card { border-color: rgba(0, 122, 255, 0.3); box-shadow: 0 20px 60px rgba(0, 122, 255, 0.15); }
.theme-wh .content-card { border-color: rgba(175, 82, 222, 0.3); box-shadow: 0 20px 60px rgba(175, 82, 222, 0.15); }

/* --- HUD --- */
#hud-overlay { position: fixed; inset: 0; background: rgba(255,255,255,0.6); backdrop-filter: blur(20px); z-index: 500; display: flex; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
#hud-overlay.open { opacity: 1; pointer-events: auto; }
.hud-card { width: 95%; max-width: 1200px; height: 90vh; background: #FFFFFF; border: 1px solid rgba(0,0,0,0.05); border-radius: 36px; display: grid; grid-template-rows: 40% 60%; overflow: hidden; box-shadow: 0 40px 80px -20px rgba(0,0,0,0.15); transform: scale(0.98); transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
#hud-overlay.open .hud-card { transform: scale(1); }
.hud-top { background: #F5F5F7; padding: 2rem; display: flex; flex-direction: column; border-bottom: 1px solid rgba(0,0,0,0.05); }
.hud-bottom { display: grid; grid-template-columns: 1fr 1.5fr 1fr; padding: 2.5rem; gap: 2rem; background: #FFFFFF; }
.hud-bottom > div { scrollbar-width: none; -ms-overflow-style: none; }
.hud-bottom > div::-webkit-scrollbar { display: none; }
.scenario-card { background: #FFFFFF; border: 1px solid rgba(0,0,0,0.05); border-radius: 24px; padding: 2.5rem; display: flex; gap: 2rem; align-items: center; display: none; height: 100%; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
.scenario-card.active { display: flex; animation: slideIn 0.4s ease-out; }
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.scenario-card .text-white { color: #1D1D1F !important; }
.scenario-card .text-gray-400 { color: #86868b !important; }
.hud-bottom .text-white { color: #1D1D1F !important; }
.word-chip { display: flex; flex-direction: column; justify-content: center; background: #F5F5F7; border-radius: 16px; padding: 1rem 1.2rem; margin-bottom: 0.8rem; border: 1px solid rgba(0,0,0,0.05); transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1); width: 100%; min-height: 80px; }
.word-chip:hover { background: #E5E5EA; transform: scale(1.01); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.chip-syn { border-left: 4px solid #34C759; }
.chip-syn:hover { border-left-color: #248a3d; }
.chip-ant { border-right: 4px solid #FF3B30; text-align: right; align-items: flex-end; }
.chip-ant:hover { border-right-color: #d12e26; }
.chip-word { font-size: 1.2rem; font-weight: 700; color: #1D1D1F; margin-bottom: 0.2rem; }
.chip-trans { font-size: 0.9rem; color: #86868b; font-weight: 400; opacity: 0; filter: blur(5px); transition: all 0.5s ease; }
.main-trans { font-size: 3.5rem; line-height: 1.1; font-weight: 900; background: linear-gradient(90deg, #007AFF, #AF52DE); -webkit-background-clip: text; -webkit-text-fill-color: transparent; opacity: 0; filter: blur(10px); transition: all 0.6s ease; margin-top: 1rem; text-transform: uppercase; letter-spacing: -0.02em; }
.scen-trans { font-size: 1.1rem; color: #86868b; font-style: italic; opacity: 0; filter: blur(8px); transition: all 0.5s ease; border-color: rgba(0,0,0,0.1) !important; }
#hud-overlay.reveal-mode .chip-trans, #hud-overlay.reveal-mode .scen-trans, #hud-overlay.reveal-mode .main-trans { opacity: 1; filter: blur(0); }

/* --- WHITEBOARD --- */
#whiteboard-overlay { position: fixed; inset: 0; z-index: 900; opacity: 0; pointer-events: none; transition: opacity 0.3s; background: rgba(255,255,255,0.4); backdrop-filter: blur(10px); }
#whiteboard-overlay.active { opacity: 1; pointer-events: auto; }
#story-canvas { width: 100%; height: 100%; cursor: none; } 
.palette-container { 
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(20px); 
    background: #FFFFFF; border: 1px solid rgba(0,0,0,0.1); border-radius: 24px; padding: 1rem 1.5rem; 
    display: flex; flex-direction: column; gap: 1rem; box-shadow: 0 20px 50px rgba(0,0,0,0.15); 
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); max-width: 90vw; cursor: default; 
}
.palette-container button, .palette-container div { cursor: pointer; }
#whiteboard-overlay.active .palette-container { transform: translateX(-50%) translateY(0); }
.palette-row { display: flex; gap: 1rem; align-items: center; overflow-x: auto; padding-bottom: 5px; scrollbar-width: none; }
.palette-row::-webkit-scrollbar { display: none; }
.tool-btn { width: 40px; height: 40px; border-radius: 12px; background: #F5F5F7; display: flex; align-items: center; justify-content: center; cursor: none; border: 1px solid rgba(0,0,0,0.05); transition: all 0.2s; flex-shrink: 0; font-size: 1.2rem; color: #1D1D1F; }
.tool-btn:hover, .tool-btn.active { background: #E5E5EA; border-color: #007AFF; transform: scale(1.1); }
.tool-btn.active { box-shadow: 0 0 10px rgba(0, 122, 255, 0.2); border-color: #007AFF; color: #007AFF; }
.color-dot { width: 30px; height: 30px; border-radius: 50%; cursor: none; border: 2px solid transparent; transition: transform 0.2s; flex-shrink: 0; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.color-dot:hover { transform: scale(1.2); }
.color-dot.active { border-color: #1D1D1F; transform: scale(1.1); box-shadow: 0 0 10px rgba(0,0,0,0.2); }
.sticker-btn { font-size: 1.8rem; padding: 0.2rem; cursor: none; transition: transform 0.2s; opacity: 1; user-select: none; }
.sticker-btn:hover, .sticker-btn.active { transform: scale(1.3); text-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.sticker-btn.active { transform: scale(1.4); }
.divider { width: 1px; height: 30px; background: rgba(0,0,0,0.1); margin: 0 0.5rem; flex-shrink: 0; }
.section-label { font-size: 0.65rem; text-transform: uppercase; color: #86868b; margin-bottom: 4px; letter-spacing: 0.1em; font-weight: 700; }

/* --- UI ELEMENTS --- */
#gallery-overlay { position: fixed; inset: 0; background: #F5F5F7; z-index: 800; display: flex; flex-direction: column; padding: 40px; opacity: 0; pointer-events: none; transition: opacity 0.4s ease; align-items: center; overflow-y: auto; cursor: default; }
#gallery-overlay.active { opacity: 1; pointer-events: auto; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; width: 100%; max-width: 1400px; padding: 20px; }
.gallery-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 12px; border: 2px solid rgba(0,0,0,0.05); cursor: none; transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); filter: none; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.gallery-thumb:hover { transform: scale(1.03); border-color: #007AFF; box-shadow: 0 15px 40px rgba(0,0,0,0.15); }
#gallery-overlay h2 { color: #1D1D1F; }
#gallery-overlay div { color: #86868b; }

#image-modal { position: fixed; inset: 0; z-index: 850; background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); display: flex; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
#image-modal.active { opacity: 1; pointer-events: auto; }
#modal-img { max-width: 90vw; max-height: 90vh; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,0.2); cursor: none; }
.close-gallery-btn { position: absolute; top: 30px; right: 30px; font-size: 2rem; color: #1D1D1F; opacity: 0.7; cursor: none; transition: all 0.2s; z-index: 860; background: #F5F5F7; width: 50px; height: 50px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(0,0,0,0.1); }
.close-gallery-btn:hover { opacity: 1; transform: scale(1.1); background: #FF3B30; color: white; border-color: #FF3B30; }

.progress-bar { height: 4px; background: linear-gradient(90deg, #FF3B30, #FF9500); width: 0%; transition: width 0.3s; }
.mode-indicator { position: fixed; top: 30px; right: 30px; z-index: 600; display: flex; gap: 8px; align-items: center; background: rgba(255,255,255,0.8); padding: 8px 16px; border-radius: 99px; border: 1px solid rgba(0,0,0,0.1); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.mode-indicator span { color: #1D1D1F !important; }
.mode-indicator .text-gray-500 { color: #86868b !important; }
.mode-dot { width: 8px; height: 8px; border-radius: 50%; background: #34C759; box-shadow: none; }
.disabled .mode-dot { background: #FF3B30; box-shadow: none; }

.key-hint { position: fixed; bottom: 30px; right: 30px; display: flex; gap: 10px; z-index: 600; }
.key-badge { background: #FFFFFF; border: 1px solid rgba(0,0,0,0.1); padding: 4px 10px; border-radius: 6px; font-size: 0.8rem; font-weight: 700; color: #86868b; backdrop-filter: blur(4px); transition: background-color 0.3s; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.key-badge.active-state { background: #007AFF; border-color: #007AFF; color: white; }
#toast { position: fixed; top: 30px; left: 50%; transform: translateX(-50%) translateY(-100px); background: #FFFFFF; border: 1px solid rgba(0, 0, 0, 0.1); color: #007AFF; padding: 1rem 2rem; border-radius: 50px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; backdrop-filter: blur(20px); z-index: 2000; transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
#toast.visible { transform: translateX(-50%) translateY(0); }

#slide-counter { position: fixed; bottom: 20px; left: 30px; background: rgba(0, 0, 0, 0.05); padding: 6px 16px; border-radius: 20px; font-size: 0.9rem; font-weight: 700; color: #86868b; backdrop-filter: blur(5px); border: 1px solid rgba(0,0,0,0.05); cursor: pointer; z-index: 600; transition: all 0.3s; }
#slide-counter:hover { background: #FFFFFF; color: #1D1D1F; transform: scale(1.05); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }

#jump-modal { position: fixed; inset: 0; background: rgba(255,255,255,0.5); backdrop-filter: blur(20px); z-index: 2000; display: flex; justify-content: center; align-items: center; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
#jump-modal.active { opacity: 1; pointer-events: auto; }
.jump-box { background: #FFFFFF; border: 1px solid rgba(0,0,0,0.1); padding: 2.5rem; border-radius: 24px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,0.1); transform: scale(0.9); transition: transform 0.3s; color: #1D1D1F; }
#jump-modal.active .jump-box { transform: scale(1); }
#jump-input { background: #F5F5F7; border: none; border-bottom: 2px solid #007AFF; color: #1D1D1F; font-size: 2.5rem; width: 120px; text-align: center; font-weight: 900; outline: none; padding: 10px; margin-top: 1rem; border-radius: 8px 8px 0 0; }
#jump-input:focus { background: #E5E5EA; border-color: #007AFF; }
.jump-hint { color: #86868b; font-size: 0.7rem; font-weight: 700; margin-top: 10px; }