/* Custom styles for Storytime Studio */
:root {
    --primary-color: #7C3AED;
    --secondary-color: #F3B664;
    --success-color: #10B981;
    --danger-color: #EF4444;
    --warning-color: #F59E0B;
    --info-color: #3B82F6;
    --light-color: #F8FAFC;
    --dark-color: #1E293B;
}

/* Override default styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

/* Story cards */
.story-card {
    aspect-ratio: 5/4;
    overflow: hidden;
    position: relative;
    border-radius: 1rem;
    transition: transform 0.2s ease, shadow 0.2s ease;
}

.story-card:active {
    transform: scale(0.95);
}

.story-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-card .content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 1rem;
    color: white;
}

/* Series cards */
.series-card {
    aspect-ratio: 1;
    overflow: hidden;
    position: relative;
    border-radius: 1rem;
    transition: transform 0.2s ease;
}

.series-card:active {
    transform: scale(0.95);
}

.series-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Audio player enhancements */
#audioPlayer {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

/* Smooth scrolling for horizontal lists */
.horizontal-scroll {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.horizontal-scroll::-webkit-scrollbar {
    display: none;
}

/* Loading states */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(100%);
    }
}

/* Touch-friendly buttons */
button {
    min-height: 44px;
    min-width: 44px;
}

/* Download indicator */
.download-indicator {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--success-color);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* Playing indicator */
.playing-indicator {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: var(--primary-color);
    color: white;
    border-radius: 0.5rem;
    padding: 0.25rem 0.75rem;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.playing-indicator .wave {
    width: 3px;
    height: 12px;
    background: currentColor;
    display: inline-block;
    animation: wave 0.7s infinite ease-in-out;
}

.playing-indicator .wave:nth-child(2) {
    animation-delay: 0.1s;
}

.playing-indicator .wave:nth-child(3) {
    animation-delay: 0.2s;
}

@keyframes wave {
    0%, 100% {
        height: 6px;
    }
    50% {
        height: 12px;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .story-card .content {
        padding: 0.5rem;
    }
    
    .series-card {
        aspect-ratio: 5/4;
    }
}

/* PWA specific styles */
@media all and (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}