/*
 * TMDB Movie Detail Page - Custom Stylesheet
 * -------------------------------------------
 * This file contains styles to replicate the look and feel of The Movie Database's
 * movie detail page.
 */

/* ==========================================================================
   Hero Section
   ========================================================================== */

body {
    background-color: #fff; /* Set main background to white */
}

.tmdb-hero-container {
    color: #dee2e6;
    width: 100%;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    position: relative;
    padding-top: 70px; /* Add padding for the fixed navbar */
}

.tmdb-hero-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(to right, rgba(22, 28, 36, 0.98) 150px, rgba(22, 28, 36, 0.88) 100%);
}

.tmdb-hero-content {
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
    padding-top: 110px; /* Navbar height + original padding */
    padding-bottom: 40px;
}

@media (min-width: 768px) {
    .tmdb-hero-content {
        flex-direction: row;
    }
}

/* Poster */
.tmdb-hero-poster {
    width: 200px;
    height: 300px;
    flex-shrink: 0;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    border: 2px solid #fff;
}

@media (min-width: 768px) {
    .tmdb-hero-poster {
        width: 300px;
        height: 450px;
    }
}

/* Main Info */
.tmdb-hero-main {
    display: flex;
    flex-direction: column;
    gap: 16px; /* Consistent gap */
}
@media (min-width: 768px) {
    .tmdb-hero-main {
        margin-top: 0;
        padding-left: 40px;
    }
}

.tmdb-hero-title {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.1;
    text-shadow: 0px 0px 10px rgba(0, 0, 0, 0.9);
    color: #dee2e6;
}

.tmdb-hero-title span {
    font-weight: 300;
    opacity: 0.8;
}

.tmdb-hero-meta {
    margin-top: 8px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 1rem;
    opacity: 0.9;
    color: #dee2e6;
}

.tmdb-hero-meta .certification {
    border: 1px solid rgba(255, 255, 255, 0.6);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1;
}

.tmdb-hero-meta .genres::before,
.tmdb-hero-meta .runtime::before {
    content: '•';
    margin-right: 15px;
}

.tmdb-hero-tagline {
    margin-top: 12px;
    font-style: italic;
    font-size: 1.1em;
    opacity: 0.7;
    text-shadow: 0px 0px 10px rgba(0, 0, 0, 0.9);
    color: #dee2e6;
}

.tmdb-hero-overview h3 {
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 8px;
    margin-top: 24px;
    text-shadow: 0px 0px 10px rgba(0, 0, 0, 0.9);
    color: #fff;
}

.tmdb-hero-overview p {
    text-shadow: 0px 0px 10px rgba(0, 0, 0, 0.9);
    color: #dee2e6;
}

.tmdb-hero-crew {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 10px;
}
.tmdb-hero-crew .name {
    font-weight: 700;
    text-shadow: 0px 0px 10px rgba(0, 0, 0, 0.9);
    color: #fff;
}
.tmdb-hero-crew .job {
    font-size: 0.9em;
    opacity: 0.8;
    text-shadow: 0px 0px 10px rgba(0, 0, 0, 0.9);
    color: #dee2e6;
}

/* Actions & User Score */
.tmdb-hero-actions {
    margin-top: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.tmdb-user-score {
    display: flex;
    align-items: center;
    gap: 15px; /* Adjust gap */
}

.tmdb-user-score span.user-score-text {
    font-weight: 700;
    line-height: 1; /* Remove line break */
    white-space: nowrap;
    color: #fff;
}

.tmdb-score-chart {
    width: 68px;
    height: 68px;
    position: relative;
    background-color: #081c22;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tmdb-score-chart .chart-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.tmdb-score-chart .chart-circle {
    stroke-width: 4;
    fill: none;
}
.tmdb-score-chart .chart-background {
    stroke: rgba(255,255,255,0.1);
}
.tmdb-score-chart .chart-bar {
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease-out;
}
.tmdb-score-chart .chart-bar.green { stroke: #21d07a; }
.tmdb-score-chart .chart-bar.yellow { stroke: #d2d531; }
.tmdb-score-chart .chart-bar.red { stroke: #db2360; }
.tmdb-score-chart .chart-bar.none { stroke: #666; }

.tmdb-score-chart .score-text {
    position: absolute;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
}
.tmdb-score-chart .score-text sup {
    font-size: 0.7rem;
    top: -0.6em;
}

.tmdb-action-btn {
    background-color: rgba(3, 37, 65, 0.8);
    border-radius: 50%;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    color: #fff;
}
.tmdb-action-btn:hover {
    background-color: #01b4e4;
    transform: scale(1.1);
}

.play-trailer-btn {
    background: none;
    border: none;
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s, transform 0.2s;
    opacity: 0.9;
}
.play-trailer-btn:hover {
    transform: scale(1.05);
}

.play-trailer-btn i {
    font-size: 1.2rem;
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */

.main-content-wrapper {
    padding: 30px 0;
}

.main-content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 1024px) {
    .main-content-grid {
        grid-template-columns: minmax(0, 2.5fr) minmax(0, 1fr);
    }
}

.main-column > .content-section:not(:last-child) {
    margin-bottom: 30px;
}

.content-section-header {
    font-size: 1.6em;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 0;
}

/* Cast Scroller */
.cast-scroller {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 15px; /* for scrollbar */
    scrollbar-color: #d1d5db #f3f4f6;
}
.cast-scroller::-webkit-scrollbar { height: 8px; }
.cast-scroller::-webkit-scrollbar-track { background: #f3f4f6; border-radius: 4px; }
.cast-scroller::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
.cast-scroller::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

.cast-card {
    width: 140px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #e3e3e3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); /* Refined shadow */
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}
.cast-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

.cast-card img {
    width: 100%;
    height: 175px;
    object-fit: cover;
    object-position: top;
}

.cast-card-info {
    padding: 10px;
}
.cast-card-info .name {
    font-weight: 700;
    font-size: 1em;
}
.cast-card-info .character {
    font-size: 0.9em;
    color: #444;
}

.cast-card.view-more {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #d1d5db;
    background: none;
    box-shadow: none;
}
.cast-card.view-more:hover {
    transform: none;
    border-color: #01b4e4;
    color: #01b4e4;
}
.view-more-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: inherit;
    text-decoration: none;
}

/* Sidebar */
.sidebar .sidebar-section:not(:last-child) {
    margin-bottom: 30px;
}

.sidebar-section h3 {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 15px;
}

.sidebar-facts-list li {
    margin-bottom: 12px;
    font-size: 0.9em;
    line-height: 1.4;
}
.sidebar-facts-list strong {
    font-weight: 600;
    margin-right: 5px;
}

.sidebar-keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.sidebar-keywords-list .keyword {
    background-color: #f2f2f2;
    padding: 5px 12px; /* Refined padding */
    border-radius: 5px;
    border: 1px solid #dcdcdc;
    font-size: 0.85em;
    color: #333;
    text-decoration: none;
}
.sidebar-keywords-list .keyword:hover {
    background-color: #dcdcdc;
    border-color: #ccc;
}

/* Sidebar Social Links */
.sidebar .social-links {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 25px;
}
.sidebar .social-link {
    font-size: 2rem; /* Increased size */
    color: #333;
    transition: color 0.2s;
}
.sidebar .social-link:hover {
    color: #01b4e4;
}

/* Tooltip for Action Buttons */
.tooltip {
    position: relative;
}
.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #111;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}
.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Media Section */
.media-section .media-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}
.media-section .media-tab-button {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 1.1em;
    font-weight: 600;
    color: #666;
    position: relative;
    transition: color 0.2s;
}
.media-section .media-tab-button.active {
    color: #032541;
}
.media-section .media-tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #01b4e4;
}
.media-section .media-tab-content {
    display: none;
}
.media-section .media-tab-content.active {
    display: block;
}

.video-scroller {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 15px;
    scrollbar-color: #d1d5db #f3f4f6;
}
.video-scroller::-webkit-scrollbar { height: 8px; }
.video-scroller::-webkit-scrollbar-track { background: #f3f4f6; border-radius: 4px; }
.video-scroller::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

.video-card {
    position: relative;
    width: 300px;
    flex-shrink: 0;
    cursor: pointer;
}
.video-card img {
    width: 100%;
    border-radius: 8px;
    display: block;
}
.video-card .play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.8);
    transition: transform 0.2s;
}
.video-card:hover .play-icon {
    transform: translate(-50%, -50%) scale(1.2);
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
}
.image-grid.posters {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.image-grid.backdrops {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.image-grid img {
    width: 100%;
    border-radius: 8px;
}

/* Recommendations Scroller */
.recommendations-scroller {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding-bottom: 15px;
    scrollbar-color: #d1d5db #f3f4f6;
}
.recommendations-scroller::-webkit-scrollbar { height: 8px; }
.recommendations-scroller::-webkit-scrollbar-track { background: #f3f4f6; border-radius: 4px; }
.recommendations-scroller::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

.recommendation-card {
    flex-shrink: 0;
    width: 250px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}
.recommendation-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}
.recommendation-card img {
    width: 100%;
    height: 141px; /* 16:9 Aspect Ratio */
    object-fit: cover;
}
.recommendation-info {
    padding: 12px;
}
.recommendation-info .title {
    font-weight: 600;
    text-decoration: none;
    color: #111;
}
.recommendation-info .date {
    font-size: 0.9em;
    color: #666;
}

/* Reviews List */
.reviews-list .review-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}
.review-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}
.review-author .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
}
.review-author .username {
    font-weight: 700;
    font-size: 1.1em;
}
.review-author .date {
    font-size: 0.9em;
    color: #666;
}
.review-content {
    line-height: 1.6;
}

.tmdb-hero-meta > span:not(:last-child)::after {
    content: "•";
    margin: 0 10px;
}

.view-more-link span {
    white-space: nowrap;
}

/* Recommendation Card Polish */
.recommendation-card .rec-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.recommendation-card:hover .rec-meta {
    opacity: 1;
}
.recommendation-card .rec-meta .vote {
    font-weight: 600;
    color: #21d07a;
}

/* Review Form Styling */
.review-form-container {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 30px;
}
.review-form .form-title {
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 16px;
}
.review-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    line-height: 1.5;
    transition: border-color 0.2s;
}
.review-form textarea:focus {
    border-color: #01b4e4;
    box-shadow: 0 0 0 3px rgba(1, 180, 228, 0.2);
}
.review-form .form-actions {
    margin-top: 16px;
    text-align: right;
}
.review-form .btn-submit {
    background-color: #01b4e4;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}
.review-form .btn-submit:hover {
    background-color: #032541;
    transform: scale(1.02);
}
.login-prompt {
    font-style: italic;
    color: #666;
}

.full-cast-link {
    margin-top: 20px;
    font-weight: 700;
    font-size: 1.1em;
}
.full-cast-link a {
    text-decoration: none;
    color: #333;
    transition: color 0.2s;
}
.full-cast-link a:hover {
    color: #01b4e4;
}

/* Where to Watch Section */
.watch-providers .provider-group {
    margin-bottom: 15px;
}
.watch-providers strong {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}
.watch-providers .provider-logos {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.watch-providers .provider-logos img {
    width: 50px; /* Increased size */
    height: 50px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Video Card with Title */
.video-card .video-thumbnail {
    position: relative;
}
.video-card .video-title {
    font-weight: 600;
    font-size: 0.95em;
    margin-top: 10px;
    line-height: 1.3;
}

/* Recommendation Card Polish */
.recommendation-poster {
    position: relative;
}
.recommendation-vote {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.2s;
}
.recommendation-card:hover .recommendation-vote {
    opacity: 1;
}
.recommendation-info .title {
    text-decoration: none;
    color: #111;
}

.tmdb-hero-actions .tooltip {
    display: none; /* Hide the extra icons */
}

/* --- Main Content Polish --- */
.content-section {
    margin-bottom: 40px; /* More spacing */
}
.cast-card, .video-card img, .image-grid img, .recommendation-card {
    transition: all 0.3s ease;
}
.cast-card:hover, .recommendation-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}
.video-card img:hover, .image-grid img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.video-card .video-title {
    color: #333;
    font-size: 0.9em;
    line-height: 1.4;
}

/* --- Review Section Polish --- */
.review-item {
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}
.review-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* --- Collection Banner --- */
.collection-banner-container {
    background-size: cover;
    background-position: center;
    position: relative;
    padding: 20px 0;
    color: #fff;
    margin-top: 30px;
}
.collection-banner-overlay {
    position: absolute;
    inset: 0;
    background: rgba(3, 37, 65, 0.88);
    backdrop-filter: blur(3px);
}
.collection-banner-content {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.collection-banner-content h3 {
    font-size: 1.4em;
    font-weight: 700;
}
.collection-banner-content p {
    font-size: 0.9em;
    opacity: 0.8;
}
.btn-view-collection {
    background-color: #01b4e4;
    color: #fff;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
}
.btn-view-collection:hover {
    background-color: #fff;
    color: #032541;
    transform: scale(1.05);
}

/* --- TMDB Review Item --- */
.review-item.tmdb-review {
    border-left: 4px solid #01b4e4;
}
.review-item.tmdb-review .review-content a {
    font-weight: 600;
    color: #01b4e4;
    text-decoration: none;
}
.review-item.tmdb-review .review-content a:hover {
    text-decoration: underline;
}

/* --- Alternative Titles --- */
.sidebar-alt-titles {
    list-style: none;
    padding-left: 0;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 5px;
}
.sidebar-alt-titles li {
    background-color: #f8f8f8;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 5px;
    font-size: 0.9em;
    display: flex;
    justify-content: space-between;
}
.sidebar-alt-titles li:last-child {
    margin-bottom: 0;
}
.sidebar-alt-titles .country-code {
    font-weight: 700;
    color: #999;
}

/* --- Video Modal --- */
.video-modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 960px;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background-color: #000;
}
.video-modal-content iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}
.video-modal-close {
    position: absolute;
    top: -30px;
    right: 0;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    font-weight: bold;
}

.image-scroller {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding-bottom: 15px;
    scrollbar-color: #d1d5db #f3f4f6;
}
.image-scroller::-webkit-scrollbar { height: 8px; }
.image-scroller::-webkit-scrollbar-track { background: #f3f4f6; border-radius: 4px; }
.image-scroller::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

.image-scroller .backdrop-item {
    flex-shrink: 0;
}
.image-scroller .backdrop-item img {
    width: 300px;
    height: 169px;
    object-fit: cover;
}

.image-scroller .poster-item {
    flex-shrink: 0;
}
.image-scroller .poster-item img {
    width: 150px;
    height: 225px;
    object-fit: cover;
}

.recommendations-scroller {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding-bottom: 15px;
    scrollbar-color: #d1d5db #f3f4f6;
}
.recommendations-scroller::-webkit-scrollbar { height: 8px; }
.recommendations-scroller::-webkit-scrollbar-track { background: #f3f4f6; border-radius: 4px; }
.recommendations-scroller::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

.video-scroller, .cast-scroller {
    scrollbar-color: #d1d5db #f3f4f6;
}
.video-scroller::-webkit-scrollbar { height: 8px; }
.video-scroller::-webkit-scrollbar-track { background: #f3f4f6; border-radius: 4px; }
.video-scroller::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; } 
} 