/* ============================================================
   SIMUPHISH ACADEMY — PREMIUM TRAINING CSS
   Style: Warm Watercolor Illustration + Modern Interactive UI
   ============================================================ */

/* ── DESIGN TOKENS ─────────────────────────────────────────── */
:root {
    /* Palette */
    --cream:    #f4edd8;
    --warm-bg:  #ede1c8;
    --dark:     #2a1f14;
    --brown:    #5e4530;
    --border:   #d4c4a8;

    --green:    #2c6e3f;
    --green-d:  #1e4e2c;
    --red:      #bd3a2a;
    --red-d:    #8f2a1d;
    --teal:     #1d6870;
    --teal-d:   #124e55;
    --amber:    #c47a22;
    --amber-d:  #9a5e18;
    --purple:   #5a3ab8;
    --purple-d: #3e268a;
    --navy:     #2c3e6e;
    --navy-d:   #1e2d52;

    /* Typography */
    --font: 'Outfit', sans-serif;
    --font-serif: 'Playfair Display', serif;
    --font-mono: 'Courier Prime', monospace;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(42,31,20,.10);
    --shadow-md: 0 6px 20px rgba(42,31,20,.15);
    --shadow-lg: 0 16px 40px rgba(42,31,20,.22);
    --shadow-xl: 0 24px 60px rgba(42,31,20,.30);

    /* Transitions */
    --ease: cubic-bezier(.25,.8,.25,1);
    --bounce: cubic-bezier(.175,.885,.32,1.275);
    --panel-ease: cubic-bezier(.22,1,.36,1);
}

/* ── RESET ──────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
html, body { width:100%; height:100%; overflow:hidden; font-family:var(--font); }
body { background:#111; display:flex; align-items:center; justify-content:center; }
button { font-family:var(--font); cursor:pointer; border:none; outline:none; }
img { display:block; }

/* ── APP SHELL ──────────────────────────────────────────────── */
.app-shell {
    width:100vw; height:100vh;
    display:flex; flex-direction:column;
    background:var(--cream);
    overflow:hidden;
}

/* ── HEADER ─────────────────────────────────────────────────── */
.app-header {
    height:62px;
    background:#fff;
    border-bottom:2px solid var(--border);
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:0 28px;
    flex-shrink:0;
    z-index:50;
}

.logo { display:flex; align-items:center; gap:8px; }
.logo-img {
    height: 28px;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(11%) sepia(20%) saturate(1472%) hue-rotate(345deg) brightness(97%) contrast(92%);
}

/* Chapter tabs */
.chapter-tabs { display:flex; gap:4px; }
.ch-tab {
    display:flex; flex-direction:column; align-items:center;
    padding:5px 16px;
    border-radius:8px;
    background:transparent;
    border:1.5px solid var(--border);
    color:var(--brown);
    transition:all .25s var(--ease);
    cursor:pointer;
}
.ch-tab .ch-num { font-size:.6rem; font-weight:800; opacity:.6; letter-spacing:1px; }
.ch-tab .ch-label { font-size:.78rem; font-weight:700; }
.ch-tab:hover { border-color:var(--dark); background:var(--warm-bg); }
.ch-tab.active {
    background:var(--green);
    border-color:var(--green-d);
    color:#fff;
}
.ch-tab.done { background:var(--warm-bg); color:var(--green); border-color:var(--green); }
.ch-tab.done::after { content:'✓'; position:absolute; top:-4px; right:-4px; font-size:.6rem; }

/* Progress */
.header-progress { display:flex; align-items:center; gap:10px; }
.progress-track {
    width:140px; height:8px;
    background:var(--border);
    border-radius:4px; overflow:hidden;
}
.progress-fill {
    height:100%; width:0;
    background:var(--green);
    border-radius:4px;
    transition:width .5s var(--ease);
}
.progress-label { font-size:.82rem; font-weight:700; color:var(--brown); white-space:nowrap; }

/* ── MAIN TRAINING STAGE ─────────────────────────────────────── */
.training-stage {
    flex:1;
    position:relative;
    overflow:hidden;
}

/* Stage screens — stacked, one active at a time */
.stage-screen {
    position:absolute; inset:0;
    opacity:0; visibility:hidden;
    transition:opacity .5s var(--ease);
}
.stage-screen.active { opacity:1; visibility:visible; }

/* ── INTRO SCREEN ──────────────────────────────────────────── */
.intro-bg {
    width:100%; height:100%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(44,110,63,.12) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 30%, rgba(189,58,42,.08) 0%, transparent 60%),
        linear-gradient(135deg, #f4edd8 0%, #ede1c8 100%);
    display:flex; align-items:center; justify-content:center;
    padding:40px;
}

.intro-card {
    background:#fff;
    border:2px solid var(--border);
    border-radius:20px;
    padding:48px 56px;
    max-width:580px;
    text-align:center;
    box-shadow:var(--shadow-lg);
    animation:floatIn .6s var(--bounce);
}

.intro-badge {
    display:inline-block;
    background:var(--green);
    color:#fff;
    font-size:.75rem; font-weight:800;
    text-transform:uppercase; letter-spacing:1.5px;
    padding:4px 14px; border-radius:20px;
    margin-bottom:20px;
}

.intro-title {
    font-family:var(--font-serif);
    font-size:2.2rem; font-style:italic;
    color:var(--dark); line-height:1.2;
    margin-bottom:14px;
}

.intro-desc {
    font-size:.95rem; line-height:1.6;
    color:var(--brown); margin-bottom:28px;
}

.intro-stats {
    display:flex; justify-content:center; gap:32px;
    margin-bottom:32px;
    border-top:1px solid var(--border);
    border-bottom:1px solid var(--border);
    padding:16px 0;
}
.stat { display:flex; flex-direction:column; align-items:center; gap:2px; }
.stat-num { font-size:1.8rem; font-weight:900; color:var(--green); line-height:1; }
.stat-txt { font-size:.72rem; font-weight:600; text-transform:uppercase; color:var(--brown); letter-spacing:.5px; }

.btn-start {
    background:var(--green);
    color:#fff;
    font-size:1rem; font-weight:800;
    padding:14px 36px;
    border-radius:10px;
    border:2px solid var(--green-d);
    letter-spacing:.5px;
    transition:all .2s var(--ease);
    box-shadow:0 4px 12px rgba(44,110,63,.3);
}
.btn-start:hover {
    background:var(--green-d);
    transform:translateY(-2px);
    box-shadow:0 8px 20px rgba(44,110,63,.4);
}

/* ── CHAPTER SCREEN ─────────────────────────────────────────── */

/* ─ Scene background (illustrated image) */
.scene-bg {
    position:absolute; inset:0;
    background-size:cover;
    background-position:center;
    transition:background-image .4s var(--ease);
    z-index:1;
}

/* ─ Video layer (over scene-bg) */
.video-layer {
    position:absolute; inset:0;
    z-index:2;
    pointer-events:auto;
}

.training-video {
    width:100%; height:100%;
    object-fit:cover;
    display:block;
}

/* Video UI overlay elements */
.video-ui {
    position:absolute; inset:0;
    display:flex; flex-direction:column;
    justify-content:space-between;
    pointer-events:none;
}

.chapter-tag {
    align-self:flex-start;
    margin:20px 24px;
    background:rgba(42,31,20,.7);
    color:#fff;
    font-size:.75rem; font-weight:800;
    text-transform:uppercase; letter-spacing:1.5px;
    padding:5px 14px; border-radius:20px;
    backdrop-filter:blur(4px);
}

.video-play-prompt {
    flex:1;
    display:flex; flex-direction:column;
    align-items:center; justify-content:center;
    gap:16px;
    pointer-events:auto;
    cursor:pointer;
}

.play-btn-circle {
    width:72px; height:72px;
    background:rgba(255,255,255,.95);
    border-radius:50%;
    display:flex; align-items:center; justify-content:center;
    box-shadow:0 8px 24px rgba(0,0,0,.3);
    transition:all .2s var(--bounce);
}
.play-btn-circle:hover { transform:scale(1.1); }

.play-icon { font-size:1.6rem; margin-left:4px; color:var(--dark); }

.play-label {
    font-size:.85rem; font-weight:800;
    color:#fff; letter-spacing:1px;
    text-transform:uppercase;
    text-shadow:0 2px 6px rgba(0,0,0,.5);
}

.video-progress-bar {
    height:5px;
    background:rgba(255,255,255,.25);
}
.video-progress-fill {
    height:100%; width:0;
    background:var(--green);
    transition:width .2s linear;
}

/* States on video layer */
.video-layer.playing .video-play-prompt { opacity:0; pointer-events:none; }
.video-layer.hidden { opacity:0; pointer-events:none; }



/* ── QUIZ PANEL ─────────────────────────────────────────────── */
.quiz-panel {
    position:absolute;
    top:0; right:0; bottom:0;
    width:58%;
    background:rgba(253,250,244,.97);
    border-left:3px solid #c8b89a;
    box-shadow:-20px 0 60px rgba(0,0,0,.22);
    z-index:10;
    display:flex;
    flex-direction:column;
    transform:translateX(110%);
    transition:transform .65s var(--panel-ease);
    will-change:transform;
    backdrop-filter:blur(6px);
}

.quiz-panel.open { transform:translateX(0); }

/* Torn paper left edge illusion */
.quiz-torn-edge {
    position:absolute;
    top:0; left:-10px; bottom:0;
    width:18px;
    background-image:
        radial-gradient(circle at 0 50%, rgba(253,250,244,.97) 6px, transparent 6px);
    background-size:18px 14px;
    background-repeat:repeat-y;
    filter:drop-shadow(-3px 0 4px rgba(0,0,0,.12));
    z-index:11;
}

.quiz-inner {
    flex:1;
    padding:28px 28px 24px 36px;
    display:flex;
    flex-direction:column;
    overflow-y:auto;
}

/* Quiz question header */
.quiz-head { margin-bottom:20px; }

.quiz-question {
    font-family:var(--font-serif);
    font-size:1.45rem; font-weight:700;
    line-height:1.3;
    color:var(--dark);
    margin-bottom:4px;
}

.quiz-sub {
    font-size:.78rem; font-weight:600;
    font-style:italic;
    color:var(--brown);
    text-transform:uppercase; letter-spacing:.5px;
}

/* ─ Options 2×3 grid ──────────────────────────────────────── */
.options-grid {
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
    margin-bottom:18px;
    flex-shrink:0;
}

/* Individual option card */
.opt-card {
    position:relative;
    display:flex;
    align-items:center;
    gap:10px;
    padding:14px 12px 14px 14px;
    border-radius:8px;
    border:none;
    cursor:pointer;
    text-align:left;
    transition:all .2s var(--bounce);
    overflow:hidden;
    min-height:72px;
    box-shadow:0 3px 8px rgba(0,0,0,.15);
}

.opt-card::before {
    content:'';
    position:absolute; inset:0;
    background:rgba(255,255,255,.08);
    opacity:0;
    transition:opacity .2s;
}
.opt-card:hover { transform:translateY(-3px) scale(1.01); box-shadow:0 6px 16px rgba(0,0,0,.22); }
.opt-card:hover::before { opacity:1; }
.opt-card:active { transform:scale(.98); }

/* Color themes matching reference */
.opt-card.clr-teal    { background:#1d6870; }
.opt-card.clr-red     { background:#bd3a2a; }
.opt-card.clr-amber   { background:#c47a22; }
.opt-card.clr-green   { background:#2c6e3f; }
.opt-card.clr-purple  { background:#5a3ab8; }
.opt-card.clr-navy    { background:#2c3e6e; }

/* Selected state */
.opt-card.selected { transform:scale(.97); box-shadow:inset 0 0 0 3px rgba(255,255,255,.5), 0 2px 6px rgba(0,0,0,.2); }

/* White checkbox on left */
.opt-checkbox {
    width:26px; height:26px; flex-shrink:0;
    border:3px solid rgba(255,255,255,.9);
    border-radius:5px;
    display:flex; align-items:center; justify-content:center;
    background:transparent;
    transition:all .2s var(--bounce);
}
.opt-card.selected .opt-checkbox {
    background:#fff;
    border-color:#fff;
}

.opt-tick {
    font-size:.9rem; font-weight:900; color:var(--dark);
    opacity:0; transform:scale(.5) rotate(-10deg);
    transition:all .25s var(--bounce);
}
.opt-card.selected .opt-tick { opacity:1; transform:scale(1) rotate(0deg); }

/* Label */
.opt-label {
    flex:1;
    font-size:.82rem; font-weight:800;
    color:#fff; line-height:1.25;
}

/* Icon on right (emoji in a circle) */
.opt-icon {
    font-size:1.15rem;
    background:rgba(255,255,255,.15);
    width:32px; height:32px; flex-shrink:0;
    border-radius:50%;
    display:flex; align-items:center; justify-content:center;
}

/* ─ Feedback bar ─────────────────────────────────────────── */
.quiz-feedback {
    display:none;
    align-items:flex-start;
    gap:12px;
    background:rgba(44,110,63,.12);
    border:2px solid var(--green);
    border-radius:10px;
    padding:12px 16px;
    margin-bottom:16px;
    animation:feedbackPop .4s var(--bounce);
}
.quiz-feedback.error {
    background:rgba(189,58,42,.10);
    border-color:var(--red);
}
.quiz-feedback.show { display:flex; }

.feedback-emoji { font-size:1.4rem; flex-shrink:0; }
.feedback-copy strong { font-size:.85rem; color:var(--dark); display:block; margin-bottom:2px; }
.feedback-copy p { font-size:.78rem; color:var(--brown); line-height:1.4; }

/* ─ Action buttons ───────────────────────────────────────── */
.btn-submit {
    width:100%;
    padding:14px;
    font-size:.88rem; font-weight:800;
    text-transform:uppercase; letter-spacing:1px;
    border-radius:10px;
    border:2.5px solid var(--dark);
    background:transparent;
    color:var(--dark);
    transition:all .2s var(--ease);
    margin-top:auto;
}
.btn-submit:not(:disabled):hover {
    background:var(--dark);
    color:#fff;
    transform:translateY(-1px);
    box-shadow:var(--shadow-md);
}
.btn-submit:disabled {
    opacity:.35;
    cursor:not-allowed;
}

.btn-next {
    width:100%;
    padding:14px;
    font-size:.88rem; font-weight:800;
    text-transform:uppercase; letter-spacing:1px;
    border-radius:10px;
    background:var(--green);
    color:#fff;
    border:2px solid var(--green-d);
    transition:all .2s var(--ease);
    margin-top:8px;
    box-shadow:0 4px 12px rgba(44,110,63,.3);
}
.btn-next:hover {
    background:var(--green-d);
    transform:translateY(-1px);
    box-shadow:0 8px 20px rgba(44,110,63,.4);
}

/* ── COMPLETION SCREEN ──────────────────────────────────────── */
.complete-bg {
    width:100%; height:100%;
    background:radial-gradient(ellipse at center, #2c6e3f22 0%, transparent 70%), var(--cream);
    display:flex; align-items:center; justify-content:center;
    padding:40px;
}

.complete-card {
    background:#fff;
    border:2px solid var(--border);
    border-radius:20px;
    padding:52px 60px;
    max-width:560px;
    text-align:center;
    box-shadow:var(--shadow-lg);
    animation:floatIn .7s var(--bounce);
}

.trophy-anim {
    font-size:4rem;
    animation:trophyBounce 1s var(--bounce) .2s both;
    display:block; margin-bottom:16px;
}

@keyframes trophyBounce {
    0% { transform:scale(0) rotate(-20deg); opacity:0; }
    100% { transform:scale(1) rotate(0); opacity:1; }
}

.complete-title {
    font-family:var(--font-serif);
    font-size:2rem; font-style:italic;
    color:var(--dark); margin-bottom:8px;
}
.complete-sub { font-size:1rem; color:var(--brown); margin-bottom:12px; }
.complete-desc { font-size:.85rem; line-height:1.6; color:var(--brown); margin-bottom:24px; }
.star-row { font-size:1.5rem; letter-spacing:4px; margin-bottom:28px; }

.btn-restart {
    background:var(--green);
    color:#fff;
    font-size:.9rem; font-weight:800;
    padding:12px 32px;
    border-radius:10px;
    border:2px solid var(--green-d);
    transition:all .2s var(--ease);
}
.btn-restart:hover { background:var(--green-d); transform:translateY(-1px); }

/* ── FOOTER ─────────────────────────────────────────────────── */
.app-footer {
    height:50px;
    background:#fff;
    border-top:2px solid var(--border);
    display:flex; align-items:center;
    justify-content:space-between;
    padding:0 24px;
    flex-shrink:0;
    z-index:50;
}

.footer-left, .footer-right { display:flex; gap:8px; }

.icon-btn {
    width:34px; height:34px;
    background:transparent;
    border-radius:7px;
    font-size:1.1rem;
    display:flex; align-items:center; justify-content:center;
    transition:background .2s;
}
.icon-btn:hover { background:var(--warm-bg); }

.footer-center { display:flex; align-items:center; gap:8px; }
.status-dot {
    width:8px; height:8px;
    border-radius:50%;
    background:#ccc;
    transition:background .3s;
}
.status-dot.on { background:var(--green); box-shadow:0 0 8px var(--green); }
.status-msg { font-size:.8rem; font-weight:600; color:var(--brown); }

/* ── UTILITY ────────────────────────────────────────────────── */
.hide { display:none !important; }

/* ── KEYFRAMES ──────────────────────────────────────────────── */
@keyframes floatIn {
    0% { opacity:0; transform:translateY(24px) scale(.97); }
    100% { opacity:1; transform:translateY(0) scale(1); }
}

@keyframes feedbackPop {
    0% { opacity:0; transform:scale(.92); }
    100% { opacity:1; transform:scale(1); }
}

@keyframes shake {
    0%,100% { transform:translateX(0); }
    20%,60% { transform:translateX(-10px); }
    40%,80% { transform:translateX(10px); }
}

@keyframes starBurst {
    0% { opacity:0; transform:scale(0) rotate(-20deg); }
    60% { opacity:1; transform:scale(1.15) rotate(5deg); }
    100% { opacity:1; transform:scale(1) rotate(0); }
}

/* ── SMS PHONE SIMULATOR ────────────────────────────────────── */
.options-grid.sms-chat-mode {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    grid-template-columns: none; /* override grid layout */
}

.sms-phone {
    width: 100%;
    max-width: 380px;
    height: 480px;
    background: #000000; /* iPhone screen black bezel */
    border: 12px solid #2a2a2a; /* thick phone frame */
    border-radius: 36px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    position: relative;
}

/* Phone notch/island */
.sms-phone::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 16px;
    background: #000000;
    border: 1.5px solid #1c1c1e;
    border-radius: 12px;
    z-index: 100;
}

/* lockscreen */
.phone-lockscreen {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1d2b64 0%, #f8cdda 100%);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 36px 20px;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.phone-lockscreen.unlocked {
    transform: translateY(-100%);
}

.lockscreen-clock {
    text-align: center;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    margin-top: 15px;
    margin-bottom: 25px;
}

.lock-date {
    font-size: 0.8rem;
    font-weight: 500;
    display: block;
    letter-spacing: 0.5px;
}

.lock-time {
    font-size: 2.8rem;
    font-weight: 700;
    display: block;
    line-height: 1.1;
    margin-top: 4px;
}

.lockscreen-notification {
    width: 100%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 18px;
    padding: 12px 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    transform: translateY(-20px);
    opacity: 0;
    animation: notifSlideDown 0.6s 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transition: transform 0.2s;
}

.lockscreen-notification:active {
    transform: scale(0.97);
}

@keyframes notifSlideDown {
    0% { transform: translateY(-20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.notif-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    opacity: 0.8;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.notif-app {
    flex: 1;
}

.notif-body strong {
    font-size: 0.8rem;
    display: block;
    margin-bottom: 2px;
}

.notif-body p {
    font-size: 0.72rem;
    line-height: 1.3;
    opacity: 0.9;
    margin: 0;
}

.notif-tap-prompt {
    font-size: 0.65rem;
    font-weight: 700;
    color: #30d158;
    text-transform: uppercase;
    margin-top: 8px;
    text-align: right;
    letter-spacing: 0.5px;
}

/* app screen */
.phone-app-screen {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #000000;
    width: 100%;
}

.phone-status-bar {
    height: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 18px 0 18px;
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    background: #1c1c1e;
    z-index: 15;
}

.status-icons {
    display: flex;
    gap: 4px;
    font-size: 0.6rem;
}

.sms-header {
    background: #1c1c1e;
    padding: 10px 16px 8px 10px; /* extra top padding for notch */
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 0.5px solid #2c2c2e;
    z-index: 10;
}

.sms-back-btn {
    background: transparent;
    border: none;
    color: #007aff;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
}

.sms-avatar {
    width: 30px;
    height: 30px;
    background: #8e8e93;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #fff;
}

.sms-sender-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.sms-sender-name {
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 600;
}

.sms-sender-status {
    color: #8e8e93;
    font-size: 0.62rem;
}

.sms-thread {
    flex: 1;
    padding: 16px;
    background: #000000;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

.sms-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 0.8rem;
    line-height: 1.4;
    animation: smsBubblePop 0.3s var(--bounce) forwards;
}

@keyframes smsBubblePop {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.sms-incoming {
    background: #1c1c1e;
    color: #ffffff;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.sms-outgoing {
    background: #007aff;
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* System message warning style */
.sms-system {
    align-self: center;
    background: rgba(255, 59, 48, 0.15);
    border: 1px solid #ff3b30;
    color: #ff453a;
    border-radius: 12px;
    max-width: 90%;
    text-align: center;
    font-weight: 500;
    font-size: 0.78rem;
}

.sms-system.success {
    background: rgba(52, 199, 89, 0.15);
    border-color: #34c759;
    color: #30d158;
}

/* Typings animation */
.sms-typing {
    align-self: flex-start;
    background: #1c1c1e;
    color: #8e8e93;
    padding: 10px 16px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 32px;
}

.sms-dot {
    width: 6px;
    height: 6px;
    background: #8e8e93;
    border-radius: 50%;
    animation: smsBounce 1.4s infinite ease-in-out both;
}

.sms-dot:nth-child(1) { animation-delay: -0.32s; }
.sms-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes smsBounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
}

/* Quick replies container inside phone */
.sms-quick-replies {
    background: #1c1c1e;
    padding: 12px 14px;
    border-top: 0.5px solid #2c2c2e;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.sms-choice-btn {
    width: 100%;
    padding: 10px 12px;
    background: #2c2c2e;
    border: none;
    color: #007aff; /* Apple Blue link color */
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 10px;
    text-align: center;
    transition: all 0.2s var(--ease);
    cursor: pointer;
    line-height: 1.35;
}

.sms-choice-btn:hover {
    background: #3a3a3c;
    color: #0a84ff;
}

.sms-choice-btn:active {
    transform: scale(0.98);
}

.sms-choice-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Reset / try again button inside SMS thread */
.sms-reset-btn {
    align-self: center;
    padding: 6px 14px;
    background: #ff453a;
    color: white;
    border-radius: 14px;
    font-size: 0.75rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255, 69, 58, 0.3);
    transition: all 0.2s;
    margin-top: 4px;
    animation: smsBubblePop 0.3s var(--bounce) forwards;
}

.sms-reset-btn:hover {
    background: #ff5e57;
    transform: translateY(-1px);
}

.phone-home-indicator {
    height: 4px;
    width: 100px;
    background: #ffffff;
    border-radius: 2px;
    align-self: center;
    margin: 6px 0;
    opacity: 0.6;
}

/* Responsive for smaller screens */
@media (max-width: 900px) {
    .quiz-panel { width:75%; }
    .chapter-tabs { display:none; }
}

.quiz-panel.full-width {
    width: 100% !important;
    border-left: none !important;
}
.quiz-panel.full-width .quiz-torn-edge {
    display: none !important;
}
/* Strip inner padding and let Gmail fill the full height */
.quiz-panel.full-width .quiz-inner {
    padding: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
}
.quiz-panel.full-width .quiz-head {
    padding: 14px 28px 10px 36px !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    border-bottom: 1px solid rgba(200,184,154,0.4);
}
.quiz-panel.full-width .quiz-question {
    font-size: 1.1rem !important;
}
.quiz-panel.full-width .quiz-sub { margin: 0 !important; }
.quiz-panel.full-width .options-grid {
    flex: 1 !important;
    overflow: hidden !important;
    display: flex !important;
    margin: 0 !important;
    padding: 0 !important;
    grid-template-columns: none !important;
    min-height: 0 !important;
}
.quiz-panel.full-width .options-grid .email-client-container {
    flex: 1;
    min-height: 0;
}
.quiz-panel.full-width .quiz-feedback {
    flex-shrink: 0;
    margin: 0 !important;
    border-radius: 0 !important;
}
.quiz-panel.full-width .btn-submit,
.quiz-panel.full-width .btn-next {
    border-radius: 0 !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}


/* ── GMAIL CLIENT SIMULATOR ─────────────────────────────────────────────── */

/* The container fills the options-grid area completely */
.email-client-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 520px;
    background: #f6f8fc;
    font-family: 'Google Sans', Roboto, Arial, sans-serif;
    color: #202124;
    overflow: hidden;
    position: relative;
}

/* ── TOPBAR ── */
.gm-topbar {
    height: 64px;
    background: #f6f8fc;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 8px;
    flex-shrink: 0;
    border-bottom: 1px solid #e0e0e0;
}
.gm-topbar-left {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 232px;
}
.gm-wordmark {
    display: flex;
    align-items: center;
    margin-left: 4px;
}
.gm-topbar-center {
    flex: 1;
}
.gm-searchbar {
    background: #eaf1fb;
    border-radius: 24px;
    height: 46px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 10px;
    max-width: 680px;
}
.gm-search-icon { display: flex; align-items: center; }
.gm-search-filter { margin-left: auto; display: flex; align-items: center; }
.gm-topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 160px;
    justify-content: flex-end;
}
.gm-apps-icon {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.gm-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: #1a73e8;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid transparent;
}

/* ── ICON BUTTON ── */
.gm-icon-btn {
    background: transparent;
    border: none;
    border-radius: 50%;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}
.gm-icon-btn:hover { background: rgba(60,64,67,0.08); }
.gm-icon-btn:disabled { opacity: 0.38; cursor: default; }
.gm-icon-btn.gm-sm { width: 32px; height: 32px; }

/* ── BODY (sidebar + content) ── */
.gm-body {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* ── LEFT SIDEBAR ── */
.gm-sidebar {
    width: 256px;
    min-width: 256px;
    padding: 8px 0;
    overflow-y: auto;
    flex-shrink: 0;
}
.gm-compose-btn {
    margin: 0 8px 8px 8px;
    padding: 16px 24px;
    background: #c2e7ff;
    color: #001d35;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1), 0 1px 3px rgba(0,0,0,0.06);
    cursor: default;
}
.gm-compose-icon { font-size: 1.1rem; }

.gm-nav { display: flex; flex-direction: column; }
.gm-nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
    height: 32px;
    border-radius: 0 16px 16px 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: #202124;
    cursor: default;
    transition: background 0.1s;
    margin-right: 16px;
}
.gm-nav-item:hover { background: #e8eaed; }
.gm-nav-active {
    background: #d3e3fd !important;
    font-weight: 700;
    color: #041e49;
}
.gm-nav-icon { width: 20px; height: 20px; flex-shrink: 0; }
.gm-nav-count {
    margin-left: auto;
    font-size: 0.8rem;
    font-weight: 400;
}
.gm-nav-more {
    display: flex; align-items: center; gap: 16px;
    padding: 0 24px; height: 32px;
    font-size: 0.875rem; font-weight: 500;
    color: #202124; cursor: default; margin-right: 16px;
}

.gm-sidebar-labels {
    margin-top: 12px;
    padding: 0 16px;
}
.gm-labels-title {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #444746;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 8px 4px;
}
.gm-label-item {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 8px;
    font-size: 0.8rem; color: #444746;
}
.gm-label-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── CONTENT AREA ── */
.gm-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-left: 1px solid #e0e0e0;
    background: #ffffff;
}

/* ── INBOX VIEW ── */
.gm-inbox-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Inbox toolbar */
.gm-inbox-toolbar {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
}
.gm-toolbar-left, .gm-toolbar-right {
    display: flex; align-items: center; gap: 4px;
}
.gm-toolbar-page { font-size: 0.8rem; color: #444746; }
.gm-checkbox { width: 15px; height: 15px; cursor: default; }

/* Inbox Tabs */
.gm-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
    background: #fff;
}
.gm-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    height: 48px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #5f6368;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.gm-tab:hover { background: #f1f3f4; }
.gm-tab-active {
    color: #1a73e8;
    border-bottom-color: #1a73e8;
    font-weight: 600;
}

/* Email List */
.gm-email-list { flex: 1; overflow-y: auto; }

.gm-email-row {
    display: flex;
    align-items: center;
    height: 56px;
    padding: 0 8px;
    border-bottom: 1px solid #f1f3f4;
    cursor: pointer;
    transition: box-shadow 0.1s, background 0.1s;
    font-size: 0.875rem;
    gap: 4px;
}
.gm-email-row:hover {
    background: #f1f3f4;
    box-shadow: inset 1px 0 0 #dadce0, inset -1px 0 0 #dadce0, 0 1px 2px rgba(60,64,67,.15);
    z-index: 2;
}
.gm-unread { font-weight: 700; }

.gm-row-check { width: 24px; flex-shrink: 0; }
.gm-row-star { width: 24px; flex-shrink: 0; display: flex; align-items: center; }
.gm-row-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    margin: 0 8px;
}
.gm-row-sender {
    width: 168px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
    font-size: 0.875rem;
}
.gm-row-snippet {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gm-row-subject { color: #202124; }
.gm-row-preview { color: #5f6368; font-weight: 400; }
.gm-row-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: 8px;
}
.gm-row-date {
    font-size: 0.75rem;
    color: #5f6368;
    white-space: nowrap;
    font-weight: 500;
}
.gm-row-attachment { font-size: 0.85rem; }

/* ── DETAIL VIEW ── */
.gm-detail-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
}

/* Detail toolbar */
.gm-detail-toolbar {
    height: 48px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0;
    gap: 2px;
}
.gm-detail-page { font-size: 0.8rem; color: #5f6368; }

/* Scrollable detail body */
.gm-detail-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
}

.gm-detail-subject {
    font-size: 1.375rem;
    font-weight: 400;
    color: #202124;
    margin: 0 0 16px;
    line-height: 1.35;
}

/* Sender block */
.gm-detail-sender-block {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}
.gm-detail-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    color: white;
    font-weight: 700; font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.gm-detail-sender-info { flex: 1; min-width: 0; }
.gm-detail-sender-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.gm-detail-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #202124;
}
.gm-detail-addr {
    font-size: 0.78rem;
    color: #444746;
    font-family: 'Google Sans Mono', 'Roboto Mono', monospace;
}
.gm-details-toggle {
    background: transparent;
    border: none;
    font-size: 0.78rem;
    color: #444746;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
}
.gm-details-toggle:hover { background: rgba(60,64,67,0.08); }
.gm-detail-time {
    font-size: 0.75rem;
    color: #5f6368;
    white-space: nowrap;
}
.gm-detail-to-row {
    font-size: 0.78rem;
    color: #5f6368;
    margin-top: 2px;
}

/* Expanded headers panel */
.email-expanded-headers {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 0.78rem;
    display: none;
    flex-direction: column;
    gap: 5px;
}
.email-expanded-headers.show { display: flex; }
.header-row { display: flex; gap: 8px; }
.header-label { width: 100px; font-weight: 600; color: #5f6368; flex-shrink: 0; }
.header-value { flex: 1; font-family: 'Roboto Mono', monospace; color: #202124; word-break: break-all; }

/* Email HTML body */
.gm-email-body {
    margin-bottom: 20px;
}
.gm-email-body-inner {
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

/* Phishing link inside body */
.gm-phish-link {
    display: inline-block;
    background: #1a73e8;
    color: white !important;
    padding: 12px 28px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    transition: background 0.2s;
}
.gm-phish-link:hover { background: #1557b0; }

/* Attachments */
.gm-attachments {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}
.gm-attach-label {
    font-size: 0.78rem;
    color: #5f6368;
    margin-bottom: 8px;
}
.gm-attach-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.gm-attach-card {
    width: 160px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.2s;
    background: #fff;
}
.gm-attach-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.gm-attach-thumb {
    height: 80px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-bottom: 1px solid #e0e0e0;
}
.gm-attach-ext {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: #ea4335;
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 3px;
}
.gm-attach-name {
    padding: 6px 8px 2px;
    font-size: 0.72rem;
    font-weight: 500;
    color: #202124;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gm-attach-size {
    padding: 0 8px 8px;
    font-size: 0.68rem;
    color: #5f6368;
}

/* ── HOTSPOTS ── */
.flag-hotspot {
    position: relative;
    border-radius: 3px;
    transition: outline 0.15s, background 0.15s;
    cursor: pointer;
    display: inline;
}
.flag-hotspot:not(.gm-phish-link):not(.gm-attach-card):hover {
    outline: 2px dashed rgba(26,115,232,0.5);
    background: rgba(26,115,232,0.06);
}
.gm-attach-card.flag-hotspot:hover { outline: 2px dashed rgba(26,115,232,0.5); }

.flag-hotspot.flagged {
    outline: 2px solid #ea4335 !important;
    background: rgba(234,67,53,0.08) !important;
}
.flag-hotspot.flagged::after {
    content: '🚩 Flagged';
    position: absolute;
    top: -20px;
    right: 0;
    background: #ea4335;
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 100;
    letter-spacing: 0.3px;
}

/* ── BROWSER STATUS BAR ── */
.simulated-status-bar {
    position: absolute;
    bottom: 0; left: 0;
    background: #f1f3f4;
    border-top: 1px solid #dadce0;
    border-right: 1px solid #dadce0;
    border-top-right-radius: 4px;
    padding: 4px 12px;
    font-size: 0.72rem;
    font-family: 'Roboto Mono', monospace;
    color: #202124;
    max-width: 70%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0.15s;
    z-index: 50;
}
.simulated-status-bar.show { opacity: 1; visibility: visible; }

