:root {
    --primary-color: #e23636;
    --secondary-color: #1a1a2e;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    opacity: 0.25;
    z-index: -1;
    filter: blur(5px);
    box-shadow: inset 0 0 200px 100px rgba(0, 0, 0, 0.95);
    transition: background-image 0.6s ease-in-out, opacity 0.6s ease-in-out;
}

main {
    flex: 1;
}

.hero {
    background: linear-gradient(135deg, rgba(226, 54, 54, 0.1) 0%, rgba(26, 26, 46, 0.3) 100%);
}

.card {
    transition: transform 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-4px);
}

.badge {
    transition: all 0.2s ease-in-out;
}

.badge:hover {
    transform: scale(1.05);
}

.navbar {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
}

.footer {
    background: rgba(26, 26, 46, 0.95);
}

.movie-card {
    border-left: 4px solid var(--primary-color);
}

.rating-badge {
    min-width: 3rem;
    justify-content: center;
}

#visualization-container {
    position: relative;
    width: 100%;
    min-height: 500px;
}

#mcu-plot {
    border: 2px solid rgba(226, 54, 54, 0.2);
}

#detail-panel .card {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#detail-panel img {
    transition: transform 0.3s ease;
}

#detail-panel img:hover {
    transform: scale(1.05);
}

.btn-group .btn {
    transition: all 0.2s ease;
}

.carousel-wrapper {
    width: 100%;
}

.card {
    border: 2px solid rgba(226, 54, 54, 0.3);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.main-card-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.main-card {
    flex: 1;
    animation: fadeIn 0.3s ease-in;
    position: relative;
}


.main-card > * {
    position: relative;
    z-index: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.nav-arrow {
    background: rgba(226, 54, 54, 0.8);
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.nav-arrow:hover {
    background: rgba(226, 54, 54, 1);
    transform: scale(1.1);
}

.nav-arrow:active {
    transform: scale(0.95);
}

.timeline-container {
    width: 100%;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1rem;
}

.timeline-wrapper {
    position: relative;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

.timeline-wrapper::-webkit-scrollbar {
    height: 8px;
}

.timeline-wrapper::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.timeline-wrapper::-webkit-scrollbar-thumb {
    background: rgba(226, 54, 54, 0.5);
    border-radius: 4px;
}

.timeline-wrapper::-webkit-scrollbar-thumb:hover {
    background: rgba(226, 54, 54, 0.8);
}

.poster-timeline {
    display: flex;
    position: relative;
    padding: 20px 0;
}

.poster-item {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: visible;
    z-index: 1;
}

.poster-item.active {
    z-index: 10;
}

.poster-item.recommended-poster {
    z-index: 2;
}

.poster-item.recommended-poster.active {
    z-index: 10;
}

.poster-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.poster-item:hover img {
    border-color: rgba(226, 54, 54, 0.6);
    transform: scale(1.05);
}

.poster-item.active img {
    border-color: rgba(226, 54, 54, 1);
    box-shadow: 0 0 20px rgba(226, 54, 54, 0.5);
    transform: scale(1.1);
}

.poster-item.recommended-poster img {
    border-color: rgba(234, 179, 8, 0.8) !important;
    animation: shimmer 2s ease-in-out infinite;
}

.poster-item.recommended-poster:hover img {
    border-color: rgba(234, 179, 8, 1) !important;
    box-shadow: 0 0 15px rgba(234, 179, 8, 0.6);
    transform: scale(1.05);
}

.poster-item.recommended-poster.active img {
    border-color: rgba(234, 179, 8, 1) !important;
    box-shadow: 0 0 20px rgba(234, 179, 8, 0.8);
    transform: scale(1.1);
}

@keyframes shimmer {
    0% {
        border-color: rgba(234, 179, 8, 0.6);
        box-shadow: 0 0 15px rgba(234, 179, 8, 0.3);
    }
    50% {
        border-color: rgba(255, 215, 0, 1);
        box-shadow: 0 0 18px rgba(255, 215, 0, 0.8);
    }
    100% {
        border-color: rgba(234, 179, 8, 0.6);
        box-shadow: 0 0 15px rgba(234, 179, 8, 0.3);
    }
}

@keyframes shimmerStar {
    0%, 100% {
        text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
        transform: scale(1);
    }
    50% {
        text-shadow: 0 0 15px rgba(255, 215, 0, 1);
        transform: scale(1.01);
    }
}

.recommended-poster-img {
    border: 3px solid rgba(234, 179, 8, 0.8) !important;
    box-shadow: 0 0 20px rgba(234, 179, 8, 0.4);
    animation: shimmer 2s ease-in-out infinite;
}

.poster-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    color: white;
    font-size: 0.6rem;
    padding: 4px 2px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.poster-item:hover .poster-title {
    opacity: 1;
}

.line-chart-overlay {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 5;
}

.recommended-star {
    animation: shimmerStar 2s ease-in-out infinite;
    display: inline-block;
}

.filter-controls {
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 8px;
}

.filter-controls .form-control {
    display: flex;
    align-items: center;
}

.filter-controls .label {
    padding: 0;
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero h2 {
        font-size: 1.75rem;
    }
    
    .main-card-container {
        flex-direction: column;
    }
    
    .nav-arrow {
        width: 50px;
        height: 50px;
    }
    
    .nav-arrow-left,
    .nav-arrow-right {
        position: absolute;
        z-index: 10;
    }
    
    .nav-arrow-left {
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .nav-arrow-right {
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .main-card {
        width: 100%;
    }
    
    #detail-panel .flex-col {
        flex-direction: column;
    }
    
    #detail-panel img {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
}
