/**
 * Unified Content Detail Layout CSS
 * Consistent styling for both movies and TV shows
 */

:root {
    --primary-color: #e50914;
    --secondary-color: #221f1f;
    --dark-bg: #141414;
    --dark-card: #1a1a1a;
    --light-text: #ffffff;
    --gray-text: #b3b3b3;
    --border-color: #333333;
    --accent-color: #ffd700;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --tv-accent: #00d4ff;
}

/* Base Styles */
body {
    background-color: var(--dark-bg);
    color: var(--light-text);
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* Enhanced Hero Section */
.hero-section {
    position: relative;
    min-height: 70vh;
    overflow: hidden;
}

.hero-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    filter: blur(8px) brightness(0.3);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 80px 0;
}

.content-poster {
    max-height: 500px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    transition: transform 0.3s ease;
}

.content-poster:hover {
    transform: scale(1.02);
}

.content-meta {
    background: rgba(26, 26, 26, 0.95);
    border-radius: 16px;
    padding: 32px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
}

.content-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 16px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.content-year {
    color: var(--gray-text);
    font-weight: 400;
}

.content-tagline {
    font-style: italic;
    opacity: 0.9;
}

.content-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.rating-badge {
    background: linear-gradient(135deg, var(--accent-color), #ffb700);
    color: #000;
    padding: 10px 16px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.status-badge {
    background: linear-gradient(135deg, var(--tv-accent), #0088cc);
    color: white;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
}

.genre-badge {
    background: rgba(255,255,255,0.15);
    color: var(--light-text);
    padding: 6px 14px;
    border-radius: 20px;
    margin: 4px 2px;
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.2s ease;
}

.genre-badge:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-1px);
}

.content-overview {
    margin-bottom: 24px;
}

/* Information Cards */
.info-card {
    background: var(--dark-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    transition: all 0.3s ease;
}

.info-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(229, 9, 20, 0.15);
}

.info-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-label {
    font-weight: 600;
    color: var(--gray-text);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-weight: 500;
    color: var(--light-text);
    font-size: 1rem;
}

/* Cast Section */
.cast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.cast-member {
    background: var(--dark-card);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.cast-member:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

.cast-photo {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--border-color);
}

.cast-info {
    padding: 12px;
}

.cast-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.cast-character {
    color: var(--gray-text);
    font-size: 0.8rem;
}

/* Networks and Production */
.network-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 16px;
}

.network-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    text-align: center;
}

.network-logo, .company-logo {
    width: 80px;
    height: 40px;
    object-fit: contain;
    background: white;
    border-radius: 4px;
    padding: 4px;
    margin-bottom: 8px;
}

.network-placeholder, .company-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #666;
}

.network-name, .company-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.network-country, .company-country {
    font-size: 0.75rem;
}

.production-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.production-company {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
}

.production-company .company-logo {
    width: 40px;
    height: 40px;
}

.company-info {
    flex: 1;
}

/* Videos Section */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
}

.video-item {
    background: var(--dark-card);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.video-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    height: 180px;
    background: #000;
}

.video-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(229, 9, 20, 0.9);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.video-info {
    padding: 12px;
}

.video-title {
    font-weight: 600;
    color: var(--light-text);
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.video-type {
    color: var(--gray-text);
    font-size: 0.8rem;
    text-transform: capitalize;
}

/* Images Section */
.images-section-title {
    color: var(--gray-text);
    margin-bottom: 12px;
    font-size: 1rem;
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}

.posters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.image-item {
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.image-item:hover {
    transform: scale(1.02);
}

.backdrop-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.poster-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

/* Seasons Section */
.season-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.season-card {
    background: var(--dark-card);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
}

.season-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

.season-poster {
    width: 100%;
    height: 280px;
    object-fit: cover;
    background: var(--border-color);
}

.season-info {
    padding: 16px;
}

.season-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 8px;
}

.season-meta {
    color: var(--gray-text);
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.season-overview {
    font-size: 0.85rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

/* Keywords Section */
.keywords-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-badge {
    background: rgba(229, 9, 20, 0.2);
    color: var(--light-text);
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.85rem;
    border: 1px solid rgba(229, 9, 20, 0.3);
    white-space: nowrap;
}

/* Similar/Recommendations Sections */
.similar-grid,
.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.similar-item,
.recommendation-item {
    text-decoration: none;
    color: inherit;
    display: block;
    background: var(--dark-card);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.similar-item:hover,
.recommendation-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    color: inherit;
    text-decoration: none;
}

.similar-poster,
.recommendation-poster {
    width: 100%;
    height: 225px;
    object-fit: cover;
}

.similar-info,
.recommendation-info {
    padding: 12px;
}

.similar-title,
.recommendation-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.similar-year,
.recommendation-year {
    font-size: 0.8rem;
}

.similar-rating,
.recommendation-rating {
    color: var(--accent-color);
    font-size: 0.8rem;
    margin-top: 4px;
}

/* Reviews Section */
.review-card {
    background: rgba(255,255,255,0.05);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 16px;
}

.review-header {
    display: flex;
    justify-content: between;
    align-items: start;
    margin-bottom: 8px;
}

.review-author {
    flex: 1;
}

.review-rating {
    color: var(--accent-color);
    font-weight: 600;
    margin-left: 8px;
}

.review-date {
    white-space: nowrap;
}

.review-content {
    line-height: 1.6;
    margin: 0;
}

.review-read-more {
    color: var(--primary-color);
    text-decoration: none;
}

.review-read-more:hover {
    text-decoration: underline;
}

/* Sidebar Styles */
.rating-card {
    background: var(--dark-card);
    border: 1px solid var(--border-color);
}

.rating-score {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent-color);
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
}

.rating-max {
    font-size: 1.2rem;
    color: var(--gray-text);
    margin-top: -8px;
}

.rating-votes {
    margin-top: 8px;
}

.rating-stars-input {
    font-size: 1.5rem;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    gap: 4px;
}

.rating-star-input {
    background: none;
    border: none;
    color: var(--border-color);
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: inherit;
}

.rating-star-input:hover {
    color: var(--accent-color);
    transform: scale(1.1);
}

.rating-star-input.active {
    color: var(--accent-color);
}

.rating-feedback {
    text-align: center;
}

.login-to-rate {
    border-radius: 8px;
    padding: 12px;
}

.technical-details .details-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* External Links */
.external-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.external-link {
    padding: 8px 16px;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    text-decoration: none;
    color: var(--light-text);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.external-link:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    color: white;
    text-decoration: none;
}

/* Watch Providers */
.providers-section {
    margin-bottom: 16px;
}

.providers-section:last-child {
    margin-bottom: 0;
}

.providers-title {
    color: var(--gray-text);
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.providers-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.provider-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.providers-unavailable {
    font-size: 0.9rem;
}

/* User Reviews Empty State */
.user-reviews {
    text-align: center;
}

.user-reviews-content {
    padding: 40px 20px;
}

.user-reviews-icon {
    font-size: 3rem;
    color: var(--gray-text);
    margin-bottom: 16px;
}

.user-reviews-title {
    margin-bottom: 8px;
}

.user-reviews-text {
    margin-bottom: 24px;
}

.write-review-btn {
    background: var(--primary-color);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
}

.login-to-review {
    padding: 12px 24px;
    border-radius: 8px;
}

/* Text Contrast Classes */
.text-ultra-contrast {
    color: #ffffff !important;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.text-high-contrast {
    color: #ffffff !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

.text-medium-contrast {
    color: #e5e5e5 !important;
}

.text-muted-contrast {
    color: #b3b3b3 !important;
}

/* Alert Styles */
.alert-status {
    border-radius: 12px;
    border: 1px solid;
    backdrop-filter: blur(10px);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
}

.alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}

/* ==========================================================================
   DELIGHT ENHANCEMENTS FOR UNIFIED CONTENT
   ========================================================================== */

/* Unified Content Type Indicators */
.content-type-indicator {
    position: absolute;
    top: 16px;
    right: 16px;
    background: linear-gradient(135deg, var(--primary-color), rgba(229, 9, 20, 0.8));
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(229, 9, 20, 0.3);
    backdrop-filter: blur(10px);
}

.content-type-indicator.tv-indicator {
    background: linear-gradient(135deg, var(--tv-accent), rgba(0, 212, 255, 0.8));
    box-shadow: 0 2px 8px rgba(0, 212, 255, 0.3);
}

/* Page Enter Animations */
.page-enter {
    animation: pageEnterSlide 0.6s ease-out;
    animation-fill-mode: both;
}

.page-enter:nth-child(1) { animation-delay: 0s; }
.page-enter:nth-child(2) { animation-delay: 0.1s; }
.page-enter:nth-child(3) { animation-delay: 0.2s; }
.page-enter:nth-child(4) { animation-delay: 0.3s; }
.page-enter:nth-child(5) { animation-delay: 0.4s; }
.page-enter:nth-child(6) { animation-delay: 0.5s; }

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

/* Enhanced Button Consistency */
.btn-primary-enhanced,
.btn-secondary-enhanced {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 8px;
}

.btn-primary-enhanced {
    background: linear-gradient(135deg, var(--primary-color), #c41e3a);
    color: white;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.3);
}

.btn-secondary-enhanced {
    background: linear-gradient(135deg, var(--secondary-color), #2a2a2a);
    color: white;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary-enhanced:hover,
.btn-secondary-enhanced:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(229, 9, 20, 0.4);
    color: white;
}

.btn-secondary-enhanced:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Unified Progress Indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--tv-accent));
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Enhanced Info Cards with Unified Styling */
.info-card {
    position: relative;
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--tv-accent));
    border-radius: 12px 12px 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.info-card:hover::before {
    opacity: 1;
}

/* Content Actions Enhancement */
.content-actions {
    position: relative;
}

.content-actions::before {
    content: '';
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--tv-accent));
    border-radius: 2px;
}

/* Unified Section Dividers */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 32px 0;
    position: relative;
}

.section-divider::after {
    content: '\2726';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--dark-bg);
    color: var(--primary-color);
    padding: 0 16px;
    font-size: 12px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .content-title {
        font-size: 2rem;
    }
    
    .hero-content {
        padding: 40px 0;
    }
    
    .content-meta {
        padding: 20px;
        margin-top: 20px;
    }
    
    .cast-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .season-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .videos-grid {
        grid-template-columns: 1fr;
    }
    
    .images-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .posters-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .content-badges {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .content-type-indicator {
        top: 8px;
        right: 8px;
        font-size: 0.75rem;
        padding: 4px 8px;
    }
}

@media (max-width: 576px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .network-grid,
    .production-grid {
        grid-template-columns: 1fr;
    }
    
    .similar-grid,
    .recommendations-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
}