/**
 * StreamVault - Movies Browse Page Styles
 * Premium cinematic styling that integrates with color theme system
 */

/* Page-specific header styles */
.browse-header {
    background: linear-gradient(135deg, 
        rgba(var(--primary-rgb), 0.1) 0%, 
        rgba(var(--secondary-rgb), 0.05) 50%, 
        rgba(var(--accent-rgb), 0.1) 100%
    );
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.recent-header {
    background: linear-gradient(135deg, 
        rgba(var(--primary-rgb), 0.1) 0%, 
        rgba(var(--secondary-rgb), 0.05) 50%, 
        rgba(var(--accent-rgb), 0.1) 100%
    );
    border-bottom: 1px solid rgba(var(--primary-rgb), 0.2);
}

.featured-header {
    background: linear-gradient(135deg, 
        rgba(var(--primary-rgb), 0.1) 0%, 
        rgba(var(--secondary-rgb), 0.05) 50%, 
        rgba(var(--accent-rgb), 0.1) 100%
    );
    border-bottom: 1px solid rgba(var(--secondary-rgb), 0.2);
}

.trending-header {
    background: linear-gradient(135deg, 
        rgba(var(--primary-rgb), 0.1) 0%, 
        rgba(var(--secondary-rgb), 0.05) 50%, 
        rgba(var(--accent-rgb), 0.1) 100%
    );
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.2);
}

/* Movie cards container */
#movies-grid {
    perspective: 1000px;
}

/* Enhanced movie card styling - Updated to match HTML classes */
.modern-card,
.movie-card {
    transform-style: preserve-3d;
    backdrop-filter: blur(10px);
    border: none !important;
    outline: none !important;
    position: relative;
    overflow: hidden;
}

.modern-card *,
.movie-card * {
    outline: none !important;
}

.modern-card:focus,
.movie-card:focus {
    outline: none !important;
    border: none !important;
}

/* Remove focus outlines from buttons and links */
.modern-card button,
.modern-card a,
.movie-card button,
.movie-card a {
    outline: none !important;
    border: none;
}

.modern-card button:focus,
.modern-card a:focus,
.movie-card button:focus,
.movie-card a:focus {
    outline: none !important;
    box-shadow: none !important;
}

.modern-card::before,
.movie-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        rgba(var(--primary-rgb), 0.6),
        rgba(var(--secondary-rgb), 0.6),
        rgba(var(--accent-rgb), 0.6)
    );
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modern-card:hover::before,
.movie-card:hover::before {
    opacity: 1;
}

.modern-card:hover,
.movie-card:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(var(--primary-rgb), 0.1);
}

/* Enhanced hover popup styling */
.modern-card .hover-popup-overlay {
    background: rgba(17, 24, 39, 0.95);
    border: none;
    backdrop-filter: blur(20px);
}

.modern-card:hover .hover-popup-overlay {
    box-shadow: 0 25px 50px -12px rgba(var(--primary-rgb), 0.15);
}

/* Button styling with theme colors */
.modern-card .play-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: 1px solid rgba(var(--primary-rgb), 0.3);
    transition: all 0.3s ease;
}

.modern-card .play-btn:hover {
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(var(--primary-rgb), 0.3);
}

.modern-card .info-btn:hover {
    background-color: rgba(var(--secondary-rgb), 0.2);
    border-color: rgba(var(--secondary-rgb), 0.3);
}

.modern-card .watchlist-btn {
    background-color: rgba(var(--secondary-rgb), 0.2);
    border: 1px solid rgba(var(--secondary-rgb), 0.3);
}

.modern-card .watchlist-btn:hover {
    background-color: rgba(var(--secondary-rgb), 0.3);
    border-color: var(--secondary);
}

/* Badge styling with theme colors */
.modern-card .rating-badge {
    background: rgba(var(--primary-rgb), 0.2);
    border: 1px solid rgba(var(--primary-rgb), 0.3);
}

.modern-card .runtime-info {
    background: rgba(var(--primary-rgb), 0.8);
    border: 1px solid rgba(var(--primary-rgb), 0.3);
}

.modern-card .type-badge {
    background: rgba(var(--primary-rgb), 0.2);
    border: 1px solid rgba(var(--primary-rgb), 0.3);
}

/* Movie card interactive elements */
.modern-card .type-badge .text-accent,
.modern-card .type-badge .bg-accent {
    color: var(--primary);
    background-color: var(--primary);
}

.modern-card .runtime-info .text-secondary {
    color: var(--primary);
}

.modern-card .rating-badge .text-accent {
    color: var(--primary);
}

/* Hover popup elements */
.modern-card .hover-popup-overlay .text-accent {
    color: var(--primary);
}

.modern-card .hover-popup-overlay .bg-primary\/20 {
    background-color: rgba(var(--primary-rgb), 0.2);
}

.modern-card .hover-popup-overlay .border-primary\/30 {
    border-color: rgba(var(--primary-rgb), 0.3);
}

.modern-card .hover-popup-overlay .text-primary {
    color: var(--primary);
}

/* Button styling */
.modern-card .watchlist-btn.bg-accent\/20 {
    background-color: rgba(var(--primary-rgb), 0.2);
}

.modern-card .watchlist-btn.hover\:bg-accent\/30:hover {
    background-color: rgba(var(--primary-rgb), 0.3);
}

.modern-card .watchlist-btn.border-accent\/30 {
    border-color: rgba(var(--primary-rgb), 0.3);
}

.modern-card .watchlist-btn.hover\:border-accent:hover {
    border-color: var(--primary);
}

.modern-card .watchlist-btn .text-accent {
    color: var(--primary);
}

/* Poster image effects */
.movie-card img {
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    filter: brightness(0.9) contrast(1.1);
}

.movie-card:hover img {
    filter: brightness(1.1) contrast(1.2) saturate(1.1);
}

/* Enhanced hover overlay */
.movie-card .absolute.inset-0 {
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.95) 0%,
        rgba(0, 0, 0, 0.7) 30%,
        rgba(0, 0, 0, 0.3) 60%,
        transparent 100%
    );
}

/* Watch Now button enhancements */
.movie-card .bg-gradient-to-r {
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3);
}

.movie-card .bg-gradient-to-r::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 ease;
}

.movie-card .bg-gradient-to-r:hover::before {
    left: 100%;
}

/* Badge styling enhancements */
.movie-card .bg-gradient-to-r.from-yellow-500,
.movie-card .bg-gradient-to-r.from-red-500,
.movie-card .bg-gradient-to-r.from-green-500 {
    animation: pulse 2s infinite;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.5);
}

.movie-card .bg-gradient-to-r.from-red-500 {
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.5);
}

.movie-card .bg-gradient-to-r.from-green-500 {
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.5);
}

/* Quality badge styling */
.movie-card .bg-black\/70 {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Navigation tabs styling */
.group.relative.px-6 {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.group.relative.px-6::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(var(--primary-rgb), 0.1),
        rgba(var(--secondary-rgb), 0.1),
        rgba(var(--accent-rgb), 0.1)
    );
    transition: width 0.3s ease;
}

.group.relative.px-6:hover::before {
    width: 100%;
}

/* Page title gradient text */
.bg-gradient-to-r.from-white {
    background-size: 200% 200%;
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .movie-card:hover {
        transform: translateY(-4px);
    }
    
    .movie-card {
        backdrop-filter: blur(5px);
    }
}

@media (max-width: 640px) {
    #movies-grid {
        gap: 0.75rem;
    }
    
    .movie-card:hover {
        transform: none;
        box-shadow: 0 10px 25px rgba(var(--primary-rgb), 0.2);
    }
}

/* Loading states */
.movie-card.loading {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.1) 25%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.1) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Enhanced scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(
        180deg, 
        rgba(var(--primary-rgb), 0.6),
        rgba(var(--secondary-rgb), 0.6)
    );
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(
        180deg, 
        rgba(var(--primary-rgb), 0.8),
        rgba(var(--secondary-rgb), 0.8)
    );
}

/* Focus states for accessibility - removed square outlines */
.modern-card:focus-within,
.movie-card:focus-within {
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.6);
}

.group.relative.px-6:focus {
    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.6);
}

/* Action Buttons Styling with Theme Support */
.modern-card .watchlist-btn {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    transition: all 0.2s ease;
}

.modern-card .watchlist-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.4);
    color: var(--primary);
}

.modern-card .watchlist-btn svg {
    color: var(--primary);
}

/* Rating Badge Theme Support */
.modern-card .rating-badge svg {
    color: var(--primary);
}

/* Type Badge Theme Support */  
.modern-card .type-badge {
    background: var(--primary);
    color: white;
}

.modern-card .type-badge .w-2 {
    background-color: var(--accent);
}

/* Runtime Info Theme Support */
.modern-card .runtime-info {
    background: rgba(var(--primary-rgb), 0.8);
    border-color: rgba(var(--primary-rgb), 0.3);
}

.modern-card .runtime-info svg {
    color: var(--accent);
}
