/**
 * Talelets Custom Styles
 * Brand-specific styles and animations
 */

/* Smooth animations */
@keyframes bounce-slow {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.animate-bounce-slow {
    animation: bounce-slow 3s ease-in-out infinite;
}

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

/* Story reader enhancements */
#story-reader {
    touch-action: pan-y pinch-zoom;
}

.story-image {
    position: relative;
    user-select: none;
    -webkit-user-drag: none;
}

.story-image img {
    display: block;
    max-width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
}

/* Smooth transitions for page navigation */
.story-image,
.story-prompt {
    transition: opacity 0.2s ease-in-out;
}

.story-image.transitioning,
.story-prompt.transitioning {
    opacity: 0.5;
}

/* Focus states for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid #FF6B35;
    outline-offset: 2px;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #FFF8F0;
}

::-webkit-scrollbar-thumb {
    background: #FF6B35;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #e55a2a;
}

/* Prevent text selection on buttons and navigation */
button,
.btn-prev,
.btn-next,
.page-indicator {
    user-select: none;
    -webkit-user-select: none;
}

/* Responsive typography */
@media (max-width: 640px) {
    html {
        font-size: 14px;
    }
}

/* Loading state for images */
img[loading="lazy"] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

img[loading="lazy"]:not([src]) {
    min-height: 300px;
}

/* Print styles */
@media print {
    header,
    footer,
    .story-nav,
    .btn-prev,
    .btn-next {
        display: none !important;
    }

    .story-image {
        page-break-inside: avoid;
    }
}

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

/* Story card hover effects */
@media (hover: hover) {
    .story-card {
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* Mobile touch feedback */
@media (hover: none) {
    .story-card:active {
        transform: scale(0.98);
    }

    button:active,
    a:active {
        transform: scale(0.95);
    }
}