/* Modern Scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background-color: #cbd5e1; border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
.dark ::-webkit-scrollbar-thumb { background-color: #475569; border-color: transparent; }
::-webkit-scrollbar-thumb:hover { background-color: #94a3b8; }
.dark ::-webkit-scrollbar-thumb:hover { background-color: #64748b; }

/* Animations */
.fade-in { animation: fadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}
.dark .glass {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.15);
}

/* Interactive Elements */
.interactive-card { transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); cursor: pointer; }
.interactive-card:hover { transform: translateY(-3px); border-color: #38bdf8; box-shadow: 0 12px 24px -5px rgba(14, 165, 233, 0.2); }
.svg-icon { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Mathematical Formatting */
.math-frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; margin: 0 0.3em; line-height: 1.2; }
.math-frac > span:first-child { border-bottom: max(1.5px, 0.1em) solid currentColor; padding: 0 0.3em; margin-bottom: 0.1em; }
.math-frac > span:last-child { padding: 0 0.3em; }
.math-vec { display: inline-flex; flex-direction: column; align-items: center; vertical-align: baseline; line-height: 1; position: relative; }
.math-vec > span:first-child { font-size: 0.7em; margin-bottom: -0.2em; opacity: 0.9; line-height: 0.5; }
.math-vec > span:last-child { font-weight: bold; font-style: italic; font-family: 'Times New Roman', serif; }

/* Exam Paper Styles */
.exam-paper { transition: background-color 0.3s, color 0.3s; }
.exam-paper input[type="radio"] { accent-color: #0ea5e9; cursor: pointer; width: 1.2rem; height: 1.2rem; }
.exam-paper input[type="text"], .exam-paper textarea {
    background: transparent; border: none; border-bottom: 1.5px solid #94a3b8; border-radius: 0;
    padding: 4px 6px; color: inherit; outline: none; font-family: inherit; transition: all 0.2s ease;
}
.dark .exam-paper input[type="text"], .dark .exam-paper textarea { border-bottom-color: #475569; }
.exam-paper input[type="text"]:focus, .exam-paper textarea:focus { border-bottom-color: #0ea5e9; border-width: 2px; }
.exam-paper .correct-text { color: #16a34a; font-weight: bold; }
.exam-paper .incorrect-text { color: #dc2626; font-weight: bold; text-decoration: line-through; }
.dark .exam-paper .correct-text { color: #4ade80; }
.dark .exam-paper .incorrect-text { color: #f87171; }

/* Sidebar Transition */
#sidebar { transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1); }
#sidebar-overlay { transition: opacity 0.35s ease; }

/* Prevent SVG interaction/saving */
svg { user-select: none; -webkit-user-drag: none; }

/* Print Styles */
@media print {
    html, body, main, #main-scroll, #content-area {
        display: block !important;
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
        position: static !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    aside, #mobile-topbar, .no-print, #sidebar-overlay { display: none !important; }
    .exam-paper { box-shadow: none !important; border: none !important; padding: 0 !important; margin: 0 !important; background: white !important; color: black !important; }
    .glass, .bg-slate-800\/60, .bg-dark-900, .dark, .bg-white, .bg-slate-50 { background-color: transparent !important; border: none !important; }
    * { text-shadow: none !important; -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
    input[type="text"], textarea { border-bottom: 1px solid black !important; color: black !important; }
    .mcq-block, .print-break-inside-avoid { break-inside: avoid; page-break-inside: avoid; margin-bottom: 20px; }
    .correct-text { color: #16a34a !important; }
    .incorrect-text { color: #dc2626 !important; }
    #dict-pro-tooltip { display: none !important; }
}

/* Tooltip Animation */
.tooltip-enter {
    animation: tooltipFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes tooltipFadeIn {
    from { opacity: 0; transform: scale(0.95) translateY(5px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
