/*
 * ACADEMIC NOIR - Premium Exam Reviewer
 * Base Styles & Global Elements
 */

/* ========================================
   GLOBAL BASE STYLES
   ======================================== */

/* Dark Theme (Default - Academic Noir) */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Decorative Background Elements */
.bg-grain {
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 1;
    opacity: 0.4;
}

.bg-ornament {
    position: fixed;
    width: 300px;
    height: 300px;
    border: 1px solid var(--color-gold);
    opacity: 0.08;
    pointer-events: none;
    z-index: 2;
    transition: all 1s var(--ease-smooth);
}

.bg-ornament.top-left {
    top: -150px;
    left: -150px;
    border-radius: 50%;
    border-width: 2px;
    transform: rotate(15deg);
}

.bg-ornament.bottom-right {
    bottom: -150px;
    right: -150px;
    border-radius: 50%;
    border-width: 2px;
    transform: rotate(-15deg);
}

/* ========================================
   TYPOGRAPHY & TEXT STYLES
   ======================================== */

/* Selection Styling */
::selection {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

/* Focus States */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}

/* ========================================
   ACCESSIBILITY & UTILITIES
   ======================================== */

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Loading State for Body */
body.loading {
    opacity: 0;
}

body.fonts-loaded {
    font-family: 'Crimson Pro', Georgia, 'Times New Roman', serif;
}

/* Critical Animation for Font Loading */
@keyframes fadeInBody {
    to { opacity: 1; }
}