/* Custom Properties */
:root {
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-bg-strong: rgba(255, 255, 255, 0.15);
    --glass-border-strong: rgba(255, 255, 255, 0.3);
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-strong: 0 20px 60px rgba(0, 0, 0, 0.15);
    --gradient-primary: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
    --gradient-accent: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
    --gradient-animated: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    --transition-duration: 0.5s;
    --blur-strength: 20px;
    --light-bg-opacity: 0.95;
    --dark-bg-opacity: 0.85;
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.dark {
    --glass-bg: rgba(0, 0, 0, 0.3);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-bg-strong: rgba(0, 0, 0, 0.4);
    --glass-border-strong: rgba(255, 255, 255, 0.15);
}

/* Glass Morphism Effects */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--card-shadow);
    transition: all var(--transition-duration) ease-in-out;
}

.glass-effect-strong {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark .glass-effect,
.dark .glass-effect-strong {
    background: rgba(17, 24, 39, 0.7);
    border-color: rgba(255, 255, 255, 0.05);
}

/* Enhanced Book Cards */
.book-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
    position: relative;
    overflow: hidden;
}

.book-card::before {
    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;
    z-index: 1;
}

.book-card:hover::before {
    left: 100%;
}

.book-card:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.15);
}

/* Star Rating */
.star-rating {
    display: inline-flex;
    gap: 0.25rem;
}

.star {
    cursor: pointer;
    transition: color 0.2s ease;
    color: #d1d5db;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.star.active {
    color: #fbbf24;
}

/* Progress Bar */
.progress-bar {
    background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 100%);
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.15) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: translateX(-100%);
    animation: shimmer 2s infinite;
}

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

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

@keyframes slideUp {
    0% { transform: translateY(100px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

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

::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.7);
}

/* Dark Mode Scrollbar */
.dark ::-webkit-scrollbar-thumb {
    background: rgba(75, 85, 99, 0.5);
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: rgba(75, 85, 99, 0.7);
}

/* Skeleton Loader */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(156, 163, 175, 0.1) 0%,
        rgba(156, 163, 175, 0.2) 50%,
        rgba(156, 163, 175, 0.1) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

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

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

.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;
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
    .book-card:hover {
        transform: translateY(-8px) scale(1.02);
    }
}

/* Reading Mode Styles */
.reading-mode {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.2rem;
    line-height: 1.8;
}

.reading-mode p {
    margin-bottom: 1.5rem;
}

.dark .reading-mode {
    background: #1a202c;
    color: #e2e8f0;
}

/* Voice Control Indicator */
.voice-active {
    background: linear-gradient(45deg, #ef4444, #f43f5e);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Book Shelf Effect */
.book-shelf {
    background: linear-gradient(to bottom, #8b4513 0%, #a0522d 100%);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

/* Enhanced Tooltips */
.tooltip {
    position: relative;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

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

/* Theme transition */
.theme-transition {
    transition: all var(--transition-duration) ease-in-out;
}

/* Background canvas */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.1;
    transition: opacity var(--transition-duration) ease-in-out;
}

/* Dark mode adjustments */
.dark #bg-canvas {
    opacity: 0.2;
}

/* Content overlay and modals */
.content-overlay, .modal-backdrop {
    position: relative;
    z-index: 10;
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    background-color: rgba(255, 255, 255, var(--light-bg-opacity));
    box-shadow: var(--card-shadow);
    transition: all var(--transition-duration) ease-in-out;
}

.dark .content-overlay, .dark .modal-backdrop {
    background-color: rgba(26, 31, 53, var(--dark-bg-opacity));
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Hide scrollbar but keep functionality */
::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

/* Tailwind config */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* Custom Tailwind classes */
@layer components {
    .btn-primary {
        @apply px-4 py-2 bg-primary-600 text-white rounded-lg 
               hover:bg-primary-700 transition-colors duration-300 
               focus:outline-none focus:ring-2 focus:ring-primary-500 
               focus:ring-offset-2 dark:focus:ring-offset-dark-DEFAULT;
    }
    
    .card {
        @apply glass-effect rounded-xl p-6 transition-all duration-300 
               hover:shadow-lg;
    }
    
    .input-field {
        @apply w-full px-4 py-2 bg-white/95 dark:bg-dark-lighter/95
               rounded-lg border border-gray-200 dark:border-gray-700
               focus:outline-none focus:ring-2 focus:ring-primary-500 
               dark:focus:ring-primary-400 transition-all duration-300;
    }

    .mood-tag {
        @apply px-3 py-1 rounded-full text-sm font-medium 
               bg-white/95 dark:bg-dark-lighter/95
               hover:bg-gray-100 dark:hover:bg-dark-accent/95
               backdrop-blur-lg transition-colors duration-200;
    }

    .genre-badge {
        @apply px-4 py-2 rounded-lg text-sm font-medium 
               bg-white/95 dark:bg-dark-lighter/95
               text-gray-800 dark:text-gray-200
               hover:bg-gray-100 dark:hover:bg-dark-accent/95
               backdrop-blur-lg transition-colors duration-200;
    }

    .stat-card {
        @apply glass-effect p-4 rounded-xl text-center
               bg-white/98 dark:bg-dark-lighter/98
               hover:bg-white dark:hover:bg-dark-accent/95
               backdrop-blur-lg transition-all duration-300;
    }

    .book-info-tag {
        @apply px-4 py-2 rounded-lg bg-gray-100/95 dark:bg-dark-lighter/95
               text-gray-700 dark:text-gray-300 text-sm font-medium;
    }
}

/* Custom Animations */
.animate-bounce-slow {
    animation: bounce 3s infinite;
}

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

/* Voice Search Animation */
@keyframes recording {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.recording {
    animation: recording 1.5s infinite;
} 