/* Sip Rater - Study Hub & Touch Flashcards CSS */

:root {
    --color-study-primary: #1e3a8a;
    --color-study-accent: #3b82f6;
    --color-study-gold: #D4AF37;
    --color-study-green: #10b981;
    --color-study-red: #ef4444;
    --color-study-card-bg: #1e293b;
}

.study-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
    padding-bottom: 6rem;
}

/* Level Switcher Pills */
.level-picker {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    margin-bottom: 1.25rem;
    scrollbar-width: thin;
}

.level-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.level-btn.active {
    background: var(--color-study-gold);
    color: #000;
    border-color: var(--color-study-gold);
    font-weight: 700;
}

/* Dynamic Cards Grid */
.study-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.study-card {
    background: var(--color-study-card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.25rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.study-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* 3D Touch-Flip Flashcard Scene */
.flashcard-scene {
    width: 100%;
    max-width: 500px;
    height: 320px;
    margin: 1.5rem auto;
    perspective: 1000px;
    cursor: pointer;
}

.flashcard {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.flashcard.flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.card-front {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: #f8fafc;
}

.card-back {
    background: linear-gradient(135deg, #1e3a8a, #0f172a);
    color: #f8fafc;
    transform: rotateY(180deg);
    border-color: rgba(59, 130, 246, 0.4);
}

.card-tag {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-study-gold);
    background: rgba(212, 175, 55, 0.15);
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.card-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    line-height: 1.5;
    margin: 1rem 0;
}

.card-hint {
    font-size: 0.85rem;
    color: #94a3b8;
    font-style: italic;
}

/* Flashcard Action Bar */
.flashcard-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    max-width: 500px;
    margin: 1rem auto;
}

.btn-missed {
    flex: 1;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.4);
    padding: 0.85rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-gotit {
    flex: 1;
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 0.85rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-missed:active, .btn-gotit:active {
    transform: scale(0.97);
}

/* Quiz Runner Styles */
.quiz-option {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

.quiz-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.quiz-option.correct {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: #34d399;
}

.quiz-option.incorrect {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #fca5a5;
}

/* ==========================================================================
   Interactive Study Tool (Reusable Template Styles across Categories/Levels)
   ========================================================================== */

body.interactive-study-page {
    background-color: var(--color-bg, #0D1C30);
    color: var(--color-text-main, #F3F4F6);
    font-family: 'Inter', sans-serif;
    padding-bottom: 5.5rem;
}

body.interactive-study-page main.study-tool-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 1rem 5.5rem 1rem;
}

body.interactive-study-page section.tab-section {
    display: block;
    animation: fadeIn 0.25s ease-out forwards;
}

body.interactive-study-page section.tab-section.hidden {
    display: none !important;
}

/* Sub-Header Banner & Module Tab Switcher */
.ist-banner {
    background: linear-gradient(135deg, rgba(30, 58, 138, 0.45), rgba(15, 23, 42, 0.8));
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ist-banner-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.ist-back-btn {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-study-gold);
    border: 1px solid rgba(212, 175, 55, 0.35);
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.ist-back-btn:hover {
    background: rgba(212, 175, 55, 0.18);
}

.ist-tab-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scrollbar-width: thin;
}

.ist-tab-nav .tab-btn {
    background: rgba(255, 255, 255, 0.07);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.55rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.ist-tab-nav .tab-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

.ist-tab-nav .tab-btn.active-tab {
    background: var(--color-study-gold) !important;
    color: #0f172a !important;
    border-color: var(--color-study-gold) !important;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.25);
}

/* Self-Test Blur Mask (Dark Theme) */
body.interactive-study-page .study-blur {
    filter: blur(5px);
    user-select: none;
    cursor: pointer;
    transition: filter 0.22s ease, background-color 0.2s ease;
    background-color: rgba(148, 163, 184, 0.22);
    border-radius: 0.375rem;
    padding: 0.1rem 0.35rem;
    display: inline-block;
}

body.interactive-study-page .study-blur:hover {
    filter: blur(2.5px);
    background-color: rgba(212, 175, 55, 0.25);
}

body.interactive-study-page .study-blur.revealed {
    filter: blur(0);
    user-select: auto;
    background-color: transparent;
    padding: 0;
}

/* Dark Theme Surface & Typography Harmonization for Interactive Study Tool */
body.interactive-study-page .bg-white {
    background-color: var(--color-study-card-bg) !important;
    color: var(--color-text-main);
}

body.interactive-study-page .bg-slate-50,
body.interactive-study-page .bg-slate-50\/70,
body.interactive-study-page .bg-slate-50\/80,
body.interactive-study-page .bg-slate-100 {
    background-color: rgba(15, 23, 42, 0.65) !important;
    color: #e2e8f0;
}

body.interactive-study-page .hover\:bg-slate-50:hover,
body.interactive-study-page .hover\:bg-slate-50\/80:hover,
body.interactive-study-page .hover\:bg-slate-200:hover {
    background-color: rgba(255, 255, 255, 0.07) !important;
}

body.interactive-study-page .border-slate-100,
body.interactive-study-page .border-slate-200,
body.interactive-study-page .border-slate-200\/80,
body.interactive-study-page .border-slate-200\/90 {
    border-color: rgba(255, 255, 255, 0.12) !important;
}

body.interactive-study-page .divide-slate-100 > :not([hidden]) ~ :not([hidden]) {
    border-color: rgba(255, 255, 255, 0.08) !important;
}

body.interactive-study-page .text-slate-900,
body.interactive-study-page .text-slate-800 {
    color: #f8fafc !important;
}

body.interactive-study-page .text-slate-700,
body.interactive-study-page .text-slate-600 {
    color: #cbd5e1 !important;
}

body.interactive-study-page .text-slate-500,
body.interactive-study-page .text-slate-400 {
    color: #94a3b8 !important;
}

body.interactive-study-page .text-wine-950,
body.interactive-study-page .text-wine-900,
body.interactive-study-page .text-wine-800,
body.interactive-study-page .text-wine-700 {
    color: var(--color-study-gold) !important;
}

body.interactive-study-page .bg-wine-50,
body.interactive-study-page .bg-wine-50\/60,
body.interactive-study-page .bg-wine-50\/80,
body.interactive-study-page .bg-wine-100 {
    background-color: rgba(212, 175, 55, 0.14) !important;
    border-color: rgba(212, 175, 55, 0.35) !important;
}

body.interactive-study-page .border-wine-200 {
    border-color: rgba(212, 175, 55, 0.35) !important;
}

body.interactive-study-page .from-wine-50\/50 {
    background: linear-gradient(135deg, rgba(159, 18, 57, 0.28), rgba(30, 41, 59, 0.9)) !important;
}

body.interactive-study-page .from-amber-50\/50 {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(30, 41, 59, 0.9)) !important;
}

body.interactive-study-page .text-amber-900,
body.interactive-study-page .text-amber-800 {
    color: #fde68a !important;
}

body.interactive-study-page .bg-amber-50,
body.interactive-study-page .bg-amber-100 {
    background-color: rgba(245, 158, 11, 0.16) !important;
    border-color: rgba(245, 158, 11, 0.35) !important;
    color: #fde68a !important;
}

body.interactive-study-page .bg-sky-50,
body.interactive-study-page .bg-sky-100 {
    background-color: rgba(56, 189, 248, 0.15) !important;
    border-color: rgba(56, 189, 248, 0.35) !important;
    color: #bae6fd !important;
}

body.interactive-study-page .bg-emerald-50,
body.interactive-study-page .bg-emerald-100 {
    background-color: rgba(16, 185, 129, 0.16) !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
    color: #a7f3d0 !important;
}

body.interactive-study-page .text-emerald-950,
body.interactive-study-page .text-emerald-900,
body.interactive-study-page .text-emerald-800 {
    color: #6ee7b7 !important;
}

body.interactive-study-page .bg-yellow-50 {
    background-color: rgba(234, 179, 8, 0.16) !important;
    border-color: rgba(234, 179, 8, 0.35) !important;
    color: #fef08a !important;
}

body.interactive-study-page .bg-rose-50 {
    background-color: rgba(244, 63, 94, 0.16) !important;
    border-color: rgba(244, 63, 94, 0.4) !important;
    color: #fecdd3 !important;
}

body.interactive-study-page .text-rose-900,
body.interactive-study-page .text-rose-800 {
    color: #fda4af !important;
}

body.interactive-study-page input[type="text"],
body.interactive-study-page select {
    background-color: #0f172a !important;
    color: #f8fafc !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

body.interactive-study-page input[type="text"]::placeholder {
    color: #64748b !important;
}

body.interactive-study-page input[type="text"]:focus,
body.interactive-study-page select:focus {
    outline: none !important;
    border-color: var(--color-study-gold) !important;
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2) !important;
}

