/* =================================================================
 *      BODY STYLES FOR FIXED BACKGROUND IMAGE
 * ================================================================= */
body {
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    position: relative;
    z-index: 0;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: color-mix(in srgb, var(--bg-color) 85%, transparent);
    z-index: -1;
}

/* =================================================================
 *      STYLES SPECIFIC TO THE MOVIE DETAIL PAGE LAYOUT
 * ================================================================= */

.movie-detail-hero {
    position: relative;
    padding: 40px 0;
    background-size: cover;
    background-position: top center;
    color: #fff;
    margin-top: 70px;
}

.movie-detail-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.6) 50%, rgba(0, 0, 0, 0.9) 100%),
        linear-gradient(to top, var(--bg-color) 0%, transparent 100%);
}

.movie-detail-hero .container {
    position: relative;
    z-index: 2;
}

.movie-poster-container img {
    border-radius: 12px;
    border: 3px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    transition: all 0.3s ease;
}

.movie-poster-container img:hover {
    transform: scale(1.05);
    border-color: var(--primary-color);
}

.movie-detail-hero h1 {
    font-weight: 700;
    font-size: 3.5rem;
    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.8);
}

.movie-detail-hero .lead {
    font-size: 1.2rem;
    line-height: 1.7;
}

.hero-actions .btn {
    margin: 5px;
}

.movie-stats {
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    backdrop-filter: blur(5px);
}

.stat-item {
    color: var(--text-light-color);
    font-size: 1rem;
}

.stat-item strong {
    color: var(--text-color);
    display: block;
    font-size: 1.2rem;
}

.ratings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.rating-box {
    background-color: var(--bg-secondary-color);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.rating-box img {
    height: 20px;
    margin-bottom: 5px;
}

.rating-box .score {
    font-weight: bold;
    color: var(--text-color);
}

.crew-info-box {
    margin-top: 1rem;
}

.crew-info-box .crew-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.crew-info-box strong {
    color: var(--primary-color);
}

.actors-list {
    font-size: 1rem;
    color: var(--text-light-color);
}

.actors-list a {
    color: var(--text-color);
    text-decoration: none;
}

.actors-list a:hover {
    color: var(--primary-color);
}

.staff-credit-card {
    background-color: var(--bg-secondary-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    text-align: center;
    height: 100%;
    display: block;
    text-decoration: none;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.staff-credit-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.staff-credit-card img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid var(--border-color);
    margin-bottom: 1rem;
}

.staff-credit-card h5 {
    color: var(--text-light-color);
    font-size: 0.9rem;
}

.staff-credit-card p {
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
    color: var(--text-color);
}

.quote-section {
    background-color: var(--bg-secondary-color);
    border-left: 5px solid var(--primary-color);
    padding: 2rem;
    border-radius: 8px;
}

.quote-section blockquote {
    font-size: 1.75rem;
    font-style: italic;
    margin: 0;
}

.quote-section cite {
    display: block;
    text-align: left;
    margin-top: 1rem;
    color: var(--text-light-color);
}

.rating-section {
    background-color: var(--bg-secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
}

.rating-stars {
    font-size: 2rem;
    color: var(--text-light-color);
    cursor: pointer;
}

.rating-stars .bi-star-fill {
    color: #FFC107;
}

.comment {
    border-top: 1px solid var(--border-color);
}

.comment .user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}

.comment .comment-meta {
    color: var(--text-light-color);
    font-size: 0.85rem;
}

.most-viewed .nav-pills .nav-link {
    background-color: var(--bg-secondary-color);
    color: var(--text-light-color);
    margin: 0 5px;
    border: 1px solid var(--border-color);
}

.most-viewed .nav-pills .nav-link.active {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* Styles for the appended modal */
#movieInfoModal #modalMoviePoster {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#movieInfoModal .modal-content {
    background-color: var(--bg-secondary-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.btn-cool {
    padding: 15px 30px;
    font-size: 1.2rem;
    border-radius: 50px;
    border: none;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-cool::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300%;
    height: 300%;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: all 0.5s ease;
    z-index: -1;
}

.btn-cool:hover::before {
    transform: translate(-50%, -50%) scale(1);
}

.btn-cool:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.movie-card {
    background-color: var(--bg-secondary-color);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    height: 100%;
}

.movie-card:hover {
    transform: scale(1.05);
    box-shadow: var(--card-shadow);
    border-color: var(--primary-color);
}

.movie-card .card-body {
    text-align: right;
}

.movie-card .card-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-card .card-text {
    font-size: 0.85rem;
    color: var(--text-light-color);
}

/* --- Stat Card Design --- */
.stat-card {
    background: var(--bg-secondary-color);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.stat-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-color);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.3);
}

.stat-card .icon-wrapper {
    font-size: 1.5rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.3s ease;
}

.stat-card:hover .icon-wrapper {
    transform: scale(1.1) rotate(5deg);
    background: rgba(var(--primary-rgb), 0.1);
}

.stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
    margin-bottom: 2px;
}

.stat-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-color);
    letter-spacing: -0.5px;
}

/* --- Universe Timeline Styles --- */
@keyframes universeGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(var(--primary-rgb), 0.3),
            0 0 40px rgba(var(--primary-rgb), 0.1),
            0 20px 40px -10px rgba(0, 0, 0, 0.5),
            inset 0 0 30px rgba(var(--primary-rgb), 0.05);
    }
    50% {
        box-shadow: 0 0 30px rgba(var(--primary-rgb), 0.5),
            0 0 60px rgba(var(--primary-rgb), 0.2),
            0 20px 40px -10px rgba(0, 0, 0, 0.5),
            inset 0 0 40px rgba(var(--primary-rgb), 0.1);
    }
}

@keyframes warningPulse {
    0%, 100% {
        background: linear-gradient(180deg, rgba(50, 255, 100, 0.15) 0%, rgba(30, 200, 80, 0.25) 50%, rgba(10, 10, 15, 0.9) 100%);
        border-color: rgba(50, 255, 100, 0.5);
    }
    50% {
        background: linear-gradient(180deg, rgba(80, 255, 150, 0.25) 0%, rgba(40, 255, 100, 0.35) 50%, rgba(10, 10, 15, 0.9) 100%);
        border-color: rgba(80, 255, 150, 0.7);
    }
}

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

@keyframes lokiRopeWeave {
    0% { background-position: 0% 0%; }
    100% { background-position: 100px 0%; }
}

/* --- Toast Styles --- */
.custom-toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 22px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    color: #fff;
    backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 250px;
    max-width: 420px;
}

.custom-toast-show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.custom-toast-hide {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
}

.custom-toast-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.92), rgba(5, 150, 105, 0.92));
    border: 1px solid rgba(52, 211, 153, 0.5);
}

.custom-toast-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.custom-toast-msg {
    flex: 1;
}

.custom-toast-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.2s;
}

.custom-toast-close:hover {
    color: #fff;
}
