/* Lumina Books - Premium E-Book Store Styles */

/* CSS Variables */
:root {
    --navy-50: #f0f4f8;
    --navy-100: #d9e2ec;
    --navy-200: #bcccdc;
    --navy-300: #9fb3c8;
    --navy-400: #829ab1;
    --navy-500: #627d98;
    --navy-600: #486581;
    --navy-700: #334e68;
    --navy-800: #243b53;
    --navy-900: #102a43;
    --navy-950: #061523;
    
    --gold-50: #fdf9f0;
    --gold-100: #f9ecd3;
    --gold-200: #f2d9a8;
    --gold-300: #eac27a;
    --gold-400: #dfa84d;
    --gold-500: #c98a2e;
    --gold-600: #a66d24;
    --gold-700: #85521e;
    --gold-800: #6d421c;
    --gold-900: #5a371a;
    
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
}

/* Dark Mode Variables */
.dark {
    --bg-primary: var(--navy-950);
    --bg-secondary: var(--navy-900);
    --bg-tertiary: var(--navy-800);
    --text-primary: #ffffff;
    --text-secondary: var(--navy-300);
    --text-muted: var(--navy-400);
    --border-color: var(--navy-800);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--navy-900);
    background-color: #ffffff;
    transition: background-color var(--transition-base), color var(--transition-base);
}

/* Dark Mode Body */
.dark body {
    background-color: var(--navy-950);
    color: #ffffff;
}

/* Typography */
.font-display {
    font-family: 'Playfair Display', Georgia, serif;
}

/* Selection */
::selection {
    background-color: var(--gold-300);
    color: var(--navy-900);
}

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

::-webkit-scrollbar-track {
    background: var(--navy-100);
}

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

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

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

/* Button Base Styles */
button {
    cursor: pointer;
    font-family: inherit;
}

/* Link Styles */
a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

/* Image Styles */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Form Elements */
input, textarea, select {
    font-family: inherit;
}

/* Animation Utilities */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

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

.animate-float {
    animation: float 6s ease-in-out infinite;
}

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

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

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

/* Stagger Animation Delays */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }

/* Hover Effects */
.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(16, 42, 67, 0.15);
}

/* Card Styles */
.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);
}

/* Filter Button Active State */
.filter-btn.active {
    background-color: var(--navy-900);
    color: white;
}

/* FAQ Styles */
.faq-item.open .faq-icon {
    transform: rotate(180deg);
}

.faq-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-base), padding var(--transition-base);
}

.faq-item.open .faq-content {
    max-height: 500px;
}

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

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

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--navy-200) 25%, var(--navy-100) 50%, var(--navy-200) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Dark Mode Specific Styles */
.dark .bg-white {
    background-color: var(--navy-900);
}

.dark .bg-navy-50 {
    background-color: var(--navy-900);
}

.dark .text-navy-900 {
    color: #ffffff;
}

.dark .text-navy-700 {
    color: var(--navy-300);
}

.dark .text-navy-600 {
    color: var(--navy-400);
}

.dark .border-navy-100 {
    border-color: var(--navy-800);
}

.dark .border-navy-200 {
    border-color: var(--navy-700);
}

/* Navigation Dark Mode */
.dark nav {
    background-color: rgba(6, 21, 35, 0.9);
    border-color: var(--navy-800);
}

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

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

/* Product Badge */
.badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-bestseller {
    background-color: var(--gold-500);
    color: var(--navy-900);
}

.badge-new {
    background-color: var(--navy-900);
    color: white;
}

.badge-sale {
    background-color: #ef4444;
    color: white;
}

/* Price Styles */
.price-original {
    text-decoration: line-through;
    color: var(--navy-400);
}

/* Star Rating */
.star-filled {
    color: var(--gold-500);
    fill: var(--gold-500);
}

.star-empty {
    color: var(--navy-300);
}

/* Responsive Typography */
@media (max-width: 640px) {
    .font-display {
        letter-spacing: -0.02em;
    }
}

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

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

/* Focus Visible for Accessibility */
button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 2px solid var(--gold-500);
    outline-offset: 2px;
}

/* Custom Selection for Dark Mode */
.dark ::selection {
    background-color: var(--gold-600);
    color: white;
}

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

/* Glass Effect */
.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.dark .glass {
    background: rgba(6, 21, 35, 0.8);
}

/* Button Shine Effect */
.btn-shine {
    position: relative;
    overflow: hidden;
}

.btn-shine::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-shine:hover::after {
    left: 100%;
}

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

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

/* Input Focus States */
input:focus,
textarea:focus,
select:focus {
    border-color: var(--gold-500);
    box-shadow: 0 0 0 3px rgba(201, 138, 46, 0.1);
}

/* Checkbox and Radio Custom Styles */
.custom-checkbox {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--navy-300);
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.custom-checkbox:checked {
    background-color: var(--navy-900);
    border-color: var(--navy-900);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 14px;
    background-position: center;
    background-repeat: no-repeat;
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 6px 12px;
    background-color: var(--navy-900);
    color: white;
    font-size: 0.75rem;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--navy-200);
    border-top-color: var(--gold-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Progress Bar */
.progress-bar {
    height: 4px;
    background-color: var(--navy-200);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-500), var(--gold-400));
    border-radius: 2px;
    transition: width var(--transition-slow);
}

/* Notification Dot */
.notification-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    border: 2px solid white;
}

/* Dark mode notification dot */
.dark .notification-dot {
    border-color: var(--navy-900);
}

/* Smooth Scroll Padding for Fixed Header */
html {
    scroll-padding-top: 100px;
}

/* Line Clamp Utility */
.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;
}

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

/* Hide Scrollbar but keep functionality */
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}