/* Premium Bookstore - Custom Styles */

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

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 99px;
}
.dark ::-webkit-scrollbar-thumb {
    background: #374151;
}

/* Line clamp utility */
.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; }

/* Animations */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeRight {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

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

[data-animate] {
    opacity: 0;
}

[data-animate].animated {
    animation-duration: 0.8s;
    animation-fill-mode: forwards;
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

[data-animate="fade-up"].animated { animation-name: fadeUp; }
[data-animate="fade-right"].animated { animation-name: fadeRight; }
[data-animate="fade-left"].animated { animation-name: fadeLeft; }

/* Nav link hover effect */
.nav-link {
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: currentColor;
    border-radius: 99px;
    transition: width 0.3s ease;
}
.nav-link:hover::after {
    width: 100%;
}

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

.dark .glass {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Toast notification */
.toast-enter {
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Prose styling for descriptions */
.prose p { margin-bottom: 1em; }
.prose p:last-child { margin-bottom: 0; }

/* Selection styling */
::selection {
    background-color: #D4A574;
    color: white;
}

/* Focus ring styling */
*:focus-visible {
    outline: 2px solid #D4A574;
    outline-offset: 2px;
    border-radius: 8px;
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

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

/* Cart badge bounce animation */
@keyframes cartBounce {
    0% { transform: scale(1); }
    25% { transform: scale(1.5); }
    50% { transform: scale(0.9); }
    75% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.animate-cart-bounce {
    animation: cartBounce 0.6s ease;
}

/* Button add-to-cart transition */
button[onclick*="addToCart"] {
    transition: all 0.2s ease;
}

/* Image lazy load transition */
img[loading="lazy"] {
    transition: opacity 0.3s ease;
}
