/* NexPlyx - Premium AI Learning Platform Styles */

:root {
    --nex-black: #0a0a0a;
    --nex-dark: #111111;
    --nex-gray: #1a1a1a;
    --nex-light: #f5f5f5;
    --nex-white: #ffffff;
    --nex-blue: #1e3a5f;
    --nex-blue-light: #2d5a87;
    --nex-gold: #c9a962;
    --nex-gold-light: #d4b978;
    
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Loading Screen Animation */
#loadingScreen {
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loadingScreen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.logo-animation svg {
    animation: logoPulse 2s ease-in-out infinite;
}

.logo-circle {
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    animation: drawCircle 1s ease forwards;
}

.logo-path {
    animation: fadeInPath 0.5s ease 0.8s forwards;
}

.wordmark-reveal span {
    animation: revealWordmark 0.6s ease 1.2s forwards;
}

@keyframes drawCircle {
    to { stroke-dashoffset: 0; }
}

@keyframes fadeInPath {
    to { opacity: 1; }
}

@keyframes revealWordmark {
    to { transform: translateY(0); }
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.9; }
}

/* Navigation Styles */
.nav-link {
    color: rgba(10, 10, 10, 0.6);
    position: relative;
}

.dark .nav-link {
    color: rgba(255, 255, 255, 0.6);
}

.nav-link:hover,
.nav-link.active {
    color: var(--nex-black);
    background: rgba(10, 10, 10, 0.05);
}

.dark .nav-link:hover,
.dark .nav-link.active {
    color: var(--nex-white);
    background: rgba(255, 255, 255, 0.1);
}

/* Glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.dark .glass {
    background: rgba(17, 17, 17, 0.8);
}

/* Book Cards */
.book-card {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.book-card:hover {
    transform: translateY(-8px);
}

.book-card:hover .book-cover {
    transform: scale(1.05);
}

.book-cover {
    transition: transform var(--transition-slow);
}

/* Card Overlay */
.card-overlay {
    opacity: 0;
    transition: opacity var(--transition-base);
}

.book-card:hover .card-overlay {
    opacity: 1;
}

/* Filter Buttons */
.filter-btn {
    background: transparent;
    color: rgba(10, 10, 10, 0.6);
    border: 1px solid rgba(10, 10, 10, 0.1);
}

.dark .filter-btn {
    color: rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.1);
}

.filter-btn:hover {
    background: rgba(10, 10, 10, 0.05);
    color: var(--nex-black);
}

.dark .filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--nex-white);
}

.filter-btn.active {
    background: var(--nex-black);
    color: var(--nex-white);
    border-color: var(--nex-black);
}

.dark .filter-btn.active {
    background: var(--nex-white);
    color: var(--nex-black);
    border-color: var(--nex-white);
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(10, 10, 10, 0.2);
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(10, 10, 10, 0.3);
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

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

/* Selection */
::selection {
    background: var(--nex-gold);
    color: var(--nex-black);
}

/* Animations */
.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

.animate-slide-up {
    animation: slideUp 0.8s ease-out forwards;
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Toast */
#toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* Mobile Menu */
#mobileMenu {
    transition: opacity var(--transition-base), transform var(--transition-base);
}

#mobileMenu.hidden {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}

/* Cart Sidebar */
#cartSidebar.open #cartPanel {
    transform: translateX(0);
}

/* Search Modal */
#searchModal.hidden {
    opacity: 0;
    pointer-events: none;
}

#searchModal {
    transition: opacity var(--transition-base);
}

/* Dropdown Animation */
.group:hover .group-hover\:visible {
    animation: dropdownFade 0.2s ease;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, var(--nex-gold) 0%, var(--nex-gold-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Aspect Ratio */
.aspect-book {
    aspect-ratio: 2 / 3;
}

/* Line Clamp */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

/* Print Styles */
@media print {
    nav, footer, #cartSidebar, #toast, #loadingScreen {
        display: none;
    }
}