.detail-content {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 2rem;
    padding: 8rem 8rem 5rem;
    align-items: flex-start;
    justify-content: center;
    max-width: 900px;
    margin: 0 auto;

}

.detail-banner {
    position: relative;
    width: 100%;
    min-height: 600px;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 80px;

}

/* add dark overlay so details are readable over banner */
.detail-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right,
            rgba(0, 0, 0, 0.85) 40%,
            rgba(0, 0, 0, 0.4) 100%);
}

/* --- Poster --- */
.detail-poster-wrapper {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    flex-shrink: 0;
    width: 220px;      
}

.detail-poster {
    width: 100%;
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* --- Info Block --- */
.detail-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    color: #fff;
    max-width: 600px;
}

.detail-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.detail-year {
    font-weight: 400;
    color: #d1d5db;
}

.detail-meta {
    font-size: 0.9rem;
    color: #d1d5db;
    margin: 0;
}

.detail-rating {
    font-size: 1rem;
    margin: 0;
}

.detail-overview {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #e5e7eb;
    margin: 0;
}

/* --- Buttons --- */
.btn-add-log {
    padding: 0.5rem 1.25rem;
    background-color: #027d96;
    color: #fff;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    width: fit-content;
    transition: background-color 0.2s ease;
}
.btn-add-log:hover {
    background-color: #025f73;
}

.btn-login-prompt {
    margin-top: 0.5rem;
    padding: 0.5rem 1.25rem;
    border: 1px solid #fff;
    color: #fff;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    width: fit-content;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.btn-login-prompt:hover {
    background-color: #fff;
    color: #000;
}

/* --- Credits Section --- */
.detail-credits {
    padding: 2rem 4rem;
    color: #fff;
    max-width: 900px;
    margin: 0 auto;
}

.detail-director {
    margin-bottom: 2rem;
}

.detail-director h3,
.detail-cast h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    border-bottom: 1px solid #2a2a2a;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.detail-director p {
    font-size: 0.95rem;
    color: #d1d5db;
    margin: 0;
}

/* --- Organize cast into grid --- */
.cast-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
}

.cast-card {
    padding: 0.25rem 0;
}

.cast-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 0.1rem 0;
}

.cast-character {
    font-size: 0.75rem;
    color: #9ca3af;
    margin: 0;
}
/* --- Dislike / Not Interested Button --- */
.detail-info .btn-dislike {
    padding: 0.5rem 1.25rem;
    background-color: transparent;
    color: #9ca3af;
    border: 1px solid #4b5563;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    width: fit-content;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn-dislike:hover {
    background-color: #7f1d1d;
    color: #fff;
    border-color: #7f1d1d;
}

.movie-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    align-self: flex-start;
    width: auto;
    margin-top: 0.5rem;
}

.movie-actions form {
    display: flex;
    margin: 0;
    padding: 0;
}

.movie-actions .btn-add-log,
.movie-actions .btn-dislike {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    margin: 0;
    width: auto;
}

/* Trailer Button */
.btn-trailer {
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

/* Modal (hidden by default) */
.trailer-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;

    align-items: center;
    justify-content: center;
}

.trailer-modal.active {
    display: flex;
}

.trailer-container {
    position: relative;
    width: 90%;
    max-width: 900px;
    aspect-ratio: 16 / 9;
}

.trailer-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Close button */
.trailer-close {
    position: absolute;
    top: -2.5rem;
    right: 0;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}



/* ---- Where to Watch Button ---- */
.btn-where-to-watch {
    padding: 0.5rem 1.25rem;
    background-color: #7c3aed;
    color: #fff;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    height: 40px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    transition: background-color 0.2s ease;
}
.btn-where-to-watch:hover { background-color: #5b21b6; }

/* ---- Where to Watch Modal ---- */
.wtw-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}
.wtw-modal.active { display: flex; }
.wtw-container {
    position: relative;
    background: #1a1a2e;
    border-radius: 0.75rem;
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    color: #fff;
}
.wtw-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #fff;
    cursor: pointer;
}
.wtw-title { font-size: 1.5rem; font-weight: 700; margin: 0 0 1.5rem 0; }
.wtw-loading { text-align: center; color: #9ca3af; padding: 2rem 0; }
.wtw-category-title {
    font-size: 1rem;
    font-weight: 600;
    color: #d1d5db;
    border-bottom: 1px solid #374151;
    padding-bottom: 0.5rem;
    margin: 1.25rem 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.wtw-provider-list { display: flex; flex-wrap: wrap; gap: 1rem; }
.wtw-provider-item { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; width: 70px; }
.wtw-provider-logo { width: 50px; height: 50px; border-radius: 0.5rem; object-fit: cover; }
.wtw-provider-name { font-size: 0.65rem; color: #9ca3af; text-align: center; word-break: break-word; }
.wtw-not-available { color: #6b7280; font-size: 0.85rem; font-style: italic; margin: 0; }
.wtw-unavailable {
    color: #fbbf24;
    font-size: 0.9rem;
    padding: 1rem;
    background: rgba(251,191,36,0.1);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}
.wtw-attribution { margin-top: 1.5rem; font-size: 0.75rem; color: #6b7280; text-align: right; }
.wtw-attribution a { color: #9ca3af; }
