@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@100..900&display=swap');

:root {
    --font-primary: 'Outfit', sans-serif;
}

body {
    font-family: var(--font-primary) !important;
    letter-spacing: -0.01em;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary) !important;
    letter-spacing: -0.04em !important;
}

p, span, button, a, input, select, textarea {
    font-family: var(--font-primary) !important;
}

/* Allow font-mono to override */
.font-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
}

body {
    background-color: #000000 !important;
    color: #e2e8f0;
    min-height: 100vh;
}

/* HIGH-END LIGHT MODE (APPLE AESTHETIC) */
body.light-mode {
    background: #ffffff !important;
    color: #000000;
}

body.light-mode h1, 
body.light-mode h2, 
body.light-mode h3,
body.light-mode h4 { 
    color: #000000 !important;
    letter-spacing: -0.04em;
    font-weight: 600;
}

/* PREMIUM MODALS FOR LIGHT MODE */
body.light-mode .glass-card {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.05) !important;
}

/* BACKDROP BLUR FOR MODALS IN LIGHT MODE */
body.light-mode .bg-black\/80,
body.light-mode .bg-black\/90 {
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(30px) !important;
}

/* THEME TOGGLE ICON FIX (RESCALED TO PREVENT CLIPPING) */
#themeToggle {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 56px !important;
    height: 56px !important;
    padding: 0 !important;
    overflow: visible !important; /* Гарантируем, что лучи не обрежутся */
}

#themeToggle svg {
    width: 20px !important; /* Немного уменьшил, чтобы лучи влезли */
    height: 20px !important;
    overflow: visible !important;
}

/* LOGIC TO SHOW ONLY ONE ICON */
body.light-mode .sun-icon { display: none !important; }
body:not(.light-mode) .moon-icon { display: none !important; }

/* SCROLL PROGRESS BAR */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(to right, #10b981, #34d399);
    z-index: 1000;
    transition: width 0.1s ease-out;
}

/* HEADER (STATIC) */
.static-header {
    width: 100%;
    z-index: 900;
}

/* PAGE TRANSITIONS */
.page-fade {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-out {
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* SKELETON PULSE */
.skeleton-pulse {
    background: linear-gradient(-90deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 100%);
    background-size: 400% 400%;
    animation: pulse 1.5s ease-in-out infinite;
}

body.light-mode .skeleton-pulse {
    background: linear-gradient(-90deg, rgba(0,0,0,0.02) 0%, rgba(0,0,0,0.05) 50%, rgba(0,0,0,0.02) 100%);
}

@keyframes pulse {
    0% { background-position: 0% 0%; }
    100% { background-position: -135% 0%; }
}

/* SYLLABUS CARDS REDESIGN (PREMIUM LOOK) */
#modalContent .grid-cols-4 > div {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 2rem;
    padding: 2rem;
    transition: all 0.3s ease;
}

body.light-mode #modalContent .grid-cols-4 > div {
    background: #fbfbfd !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
}

/* LESSON CARDS REDESIGN */
#modalContent .space-y-4 > div {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1.5rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#modalContent .space-y-4 > div:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(10px);
    border-color: rgba(16, 185, 129, 0.3);
}

body.light-mode #modalContent .space-y-4 > div {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

body.light-mode #modalContent .space-y-4 > div:hover {
    background: #f5f5f7 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* LESSON NUMBER BADGE */
#modalContent .lesson-number {
    width: 48px;
    height: 48px;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}


/* FORCE ABSOLUTE BLACK TEXT IN LIGHT MODE (Only for non-primary elements) */
body.light-mode p,
body.light-mode span,
body.light-mode h1,
body.light-mode h2,
body.light-mode h3,
body.light-mode h4,
body.light-mode select,
body.light-mode input,
body.light-mode #modalContent div:not(.lesson-number),
body.light-mode #resultContainer .result-text {
    color: #000000 !important;
    opacity: 1 !important;
}

/* Specific Navigation Contrast */
body.light-mode nav a,
body.light-mode nav button:not(.bg-blue-600):not(.bg-emerald-500),
body.light-mode header a,
body.light-mode header button:not(.bg-emerald-500) {
    color: #000000 !important;
}

/* EXCEPTIONS FOR EMERALD TEXT */
body.light-mode .text-emerald-500,
body.light-mode .lesson-number {
    color: #10b981 !important;
}

/* GENERAL STYLES */
.glass-card {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.emerald-gradient {
    background: radial-gradient(circle at top right, rgba(16, 185, 129, 0.1), transparent 50%), 
                radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.05), transparent 50%);
    background-attachment: fixed;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in {
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* CUSTOM SCROLLBAR FOR MODALS */
.custom-scrollbar::-webkit-scrollbar { width: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }
body.light-mode .custom-scrollbar::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.1); }

/* CSS FOR CERTIFICATE MODAL (DARK MODE DEFAULT) */
.cert-bg {
    background: linear-gradient(to bottom right, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    border-color: rgba(255,255,255,0.1);
}
.cert-glow-1 { background-color: rgba(16, 185, 129, 0.3); }
.cert-glow-2 { background-color: rgba(59, 130, 246, 0.2); }
.cert-watermark { color: rgba(255,255,255,0.02); }
.cert-badge-bg { background: rgba(16, 185, 129, 0.1); }
.cert-badge-border { border-color: rgba(16, 185, 129, 0.2); }
.cert-badge-text { color: #34d399; }
.cert-title { color: #ffffff; }
.cert-border { border-color: rgba(255,255,255,0.1); }
.cert-box { background: rgba(15,23,42,0.5); border-color: rgba(255,255,255,0.05); }
.cert-label { color: #94a3b8; }
.cert-text { color: #ffffff; }
.cert-icon-bg { background: rgba(255,255,255,0.05); }
.cert-icon-text { color: #34d399; } /* Blue is handled inline */

.cert-input { 
    background: rgba(15,23,42,0.5); 
    color: #ffffff; 
    border-color: rgba(255,255,255,0.1); 
}
.cert-input::placeholder { color: #64748b; }
.cert-btn-text { color: #0f172a; }

/* CSS FOR CERTIFICATE MODAL (LIGHT MODE OVERRIDES) */
body.light-mode .cert-bg {
    background: #ffffff !important;
    border-color: rgba(0,0,0,0.1) !important;
}
body.light-mode .cert-glow-1 { background-color: rgba(16, 185, 129, 0.1); }
body.light-mode .cert-glow-2 { background-color: rgba(59, 130, 246, 0.05); }
body.light-mode .cert-watermark { color: rgba(0,0,0,0.03); }
body.light-mode .cert-badge-bg { background: rgba(16, 185, 129, 0.05); }
body.light-mode .cert-badge-border { border-color: rgba(16, 185, 129, 0.2); }
body.light-mode .cert-badge-text { color: #059669; }
body.light-mode .cert-title { color: #0f172a !important; }
body.light-mode .cert-border { border-color: rgba(0,0,0,0.05); }
body.light-mode .cert-box { background: #f8fafc !important; border-color: rgba(0,0,0,0.05) !important; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02) !important; }
body.light-mode .cert-label { color: #64748b !important; }
body.light-mode .cert-text { color: #0f172a !important; }
body.light-mode .cert-icon-bg { background: #ffffff !important; }

body.light-mode .cert-input { 
    background: rgba(241, 245, 249, 0.8) !important; 
    color: #0f172a !important; 
    border-color: rgba(0,0,0,0.1) !important; 
}
body.light-mode .cert-input::placeholder { color: #94a3b8 !important; }
body.light-mode .cert-btn-text { color: #ffffff !important; }

/* MOBILE BOTTOM NAVIGATION */
.mobile-nav-link { color: #cbd5e1; }
body.light-mode .mobile-nav-link { color: #1e293b !important; }

/* SKELETON LOADER ANIMATIONS */
@keyframes skeleton-pulse {
    0% { opacity: 0.5; }
    50% { opacity: 0.2; }
    100% { opacity: 0.5; }
}

.skeleton-pulse {
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
}

body.light-mode .skeleton-item {
    background: rgba(0, 0, 0, 0.05) !important;
}

/* Hide Scrollbar for Carousel */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* SVG CHECKMARK ANIMATION */
.checkmark__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: #10b981;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: block;
    stroke-width: 2;
    stroke: #fff;
    stroke-miterlimit: 10;
    margin: 10% auto;
    box-shadow: inset 0px 0px 0px #10b981;
    animation: fill .4s ease-in-out .4s forwards, scale .3s ease-in-out .9s both;
}

.checkmark__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
    100% { stroke-dashoffset: 0; }
}
@keyframes scale {
    0%, 100% { transform: none; }
    50% { transform: scale3d(1.1, 1.1, 1); }
}
@keyframes fill {
    100% { box-shadow: inset 0px 0px 0px 50px #10b981; }
}

/* TEACHER PHOTO ENHANCEMENT */
.glass-card img {
    filter: contrast(1.05) brightness(1.02) saturate(1.1);
    image-rendering: -webkit-optimize-contrast;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card .shrink-0.rounded-\[2\.5rem\],
.glass-card .w-32.h-32 {
    position: relative;
    overflow: hidden;
    background: #0f172a;
}

/* Studio Light Overlay */
.glass-card .shrink-0.rounded-\[2\.5rem\]::after,
.glass-card .w-32.h-32::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.4) 0%, transparent 50%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
    z-index: 2;
}

/* Portrait Hover Glow */
.glass-card:hover img {
    filter: contrast(1.1) brightness(1.05) saturate(1.15);
    transform: scale(1.08);
}
