/* Movie Detail Page Styles */

/* Movie detail page specific styles */
.movie-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1rem 2rem;
}

.movie-detail-container .back-button {
    margin-bottom: 1rem;
}

body .movie-detail-container .back-button .btn,
body .movie-detail-container .back-button a.btn,
body .movie-detail-container .back-button a[href="/movies/"] {
    background-color: white !important;
    border: 1px solid #e9ecef !important;
    color: #6c757d !important;
    padding: 0.5rem 1rem !important;
    border-radius: 0.5rem !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    display: inline-block !important;
    font-weight: 400 !important;
}

body .movie-detail-container .back-button .btn:hover,
body .movie-detail-container .back-button a.btn:hover,
body .movie-detail-container .back-button a[href="/movies/"]:hover,
body .movie-detail-container .back-button .btn:focus,
body .movie-detail-container .back-button a.btn:focus,
body .movie-detail-container .back-button a[href="/movies/"]:focus {
    background-color: #f8f9fa !important;
    border-color: #667eea !important;
    color: #667eea !important;
    text-decoration: none !important;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25) !important;
}

@media (max-width: 768px) {
    .movie-detail-container {
        padding: 1rem;
    }
}

.movie-poster-detail-container {
    position: sticky;
    top: 20px;
}

.movie-poster-detail {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
}

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

.movie-poster-placeholder-detail {
    width: 100%;
    height: 400px;
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
    border-radius: 10px;
    border: 2px dashed #dee2e6;
}

.rating-display {
    background: rgba(255,255,255,0.95);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.rating-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 5px;
}

.movie-detail-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    position: relative;
    z-index: 2;
}

.movie-title-main {
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 10px;
    font-size: 2.5rem;
}

.movie-title-alt {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 0;
}

.movie-meta {
    border-bottom: 2px solid #f8f9fa;
    padding-bottom: 15px;
}

.movie-meta .badge {
    padding: 8px 12px;
    font-size: 0.9rem;
}

.movie-genres .badge {
    font-size: 0.85rem;
    padding: 6px 12px;
    margin-right: 5px;
    margin-bottom: 5px;
}

.movie-overview {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.movie-overview h5 {
    color: #495057;
    margin-bottom: 15px;
    font-weight: 600;
}

.movie-overview p {
    line-height: 1.7;
    color: #6c757d;
    margin-bottom: 0;
}

.movie-overview blockquote {
    background: rgba(0,123,255,0.1);
    border-radius: 8px;
    padding: 15px;
    border: none;
    margin: 0 0 15px 0;
}

.overview-section {
    background: #ffffff;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.overview-section h6 {
    color: #495057;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.overview-section p {
    color: #6c757d;
    margin-bottom: 0;
    font-size: 1rem;
}

/* 中文overview特殊样式 */
.overview-section:last-child {
    background: rgba(40, 167, 69, 0.05);
    border-color: #c3e6cb;
}

.movie-credits .credit-section {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
}

.movie-credits .badge {
    font-size: 0.8rem;
    padding: 5px 10px;
    margin: 2px;
}

.movie-specs {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.movie-specs strong {
    color: #495057;
}

.movie-production {
    border-top: 1px solid #e9ecef;
    padding-top: 20px;
}

.movie-production .badge {
    font-size: 0.8rem;
    padding: 6px 12px;
    margin: 2px;
    background-color: transparent !important;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.movie-backdrop-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.movie-backdrop-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.1;
    filter: blur(3px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .movie-title-main {
        font-size: 1.8rem;
    }
    
    .movie-title-alt {
        font-size: 1.2rem;
    }
    
    .movie-detail-content {
        padding: 20px;
    }
    
    .movie-poster-detail-container {
        position: static;
        margin-bottom: 20px;
    }
    
    .rating-display {
        margin-bottom: 20px;
    }
    
    .overview-section {
        padding: 12px;
    }
    
    .overview-section h6 {
        font-size: 0.8rem;
    }
    
    .overview-section p {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .movie-meta {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .movie-meta .badge {
        margin-bottom: 5px;
    }
    
    .movie-title-main {
        font-size: 1.5rem;
    }
}

.movie-credits .badge:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease;
}

.movie-genres .badge:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.movie-detail-content {
    animation: fadeInUp 0.6s ease;
}

.movie-poster-detail {
    animation: fadeInUp 0.4s ease;
}

.movie-overview::-webkit-scrollbar {
    width: 6px;
}

.movie-overview::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.movie-overview::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.movie-overview::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Reviews Section Styles */
.reviews-section {
    background-color: #f8f9fa;
    padding: 2rem;
    border-radius: 15px;
}

/* Mobile responsive reviews section */
@media (max-width: 768px) {
    .reviews-section {
        margin-left: -15px;
        margin-right: -15px;
        border-radius: 0;
        padding: 1.5rem 1rem;
    }
}

@media (max-width: 576px) {
    .reviews-section {
        margin-left: -1rem;
        margin-right: -1rem;
        padding: 1rem;
    }
}

.review-form {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
}

.score-input {
    max-width: 80px;
}

.alert-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

/* Score Breakdown Styling */
.score-breakdown {
    background: transparent;
    border-radius: 0;
    padding: 0.5rem 0;
    border: none;
    box-shadow: none;
}

.score-breakdown h6 {
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.score-breakdown .table {
    margin-bottom: 0;
    table-layout: fixed;
    width: 100%;
}

.score-breakdown .table th {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.25rem 0.5rem;
    border: none;
    background: none;
    width: 14.28%; /* 100% / 7 columns = equal width */
}

.score-breakdown .table td {
    padding: 0.5rem 0.25rem;
    border: none;
    vertical-align: middle;
    width: 14.28%; /* 100% / 7 columns = equal width */
}

.score-breakdown .badge {
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    min-width: 2.5rem;
    transition: all 0.2s ease;
}

/* Ensure all rating scores are properly aligned */
.table td {
    text-align: center !important;
}

.table .badge {
    min-width: 32px;
    display: inline-block;
    text-align: center;
}

/* Mobile responsive table styling */
@media (max-width: 767px) {
    .table-responsive table {
        font-size: 0.875rem;
    }
    
    .table th {
        font-size: 0.75rem;
        padding: 0.25rem 0.125rem;
    }
    
    .table td {
        padding: 0.375rem 0.125rem;
        text-align: right !important;
    }
    
    .table .badge {
        font-size: 0.75rem;
        min-width: 28px;
        padding: 0.25rem 0.375rem;
        margin-left: auto;
        display: block;
        width: fit-content;
    }
}

/* Ensure consistent badge sizes across all screens */
.badge.rounded-pill {
    min-width: 32px;
    font-weight: 600;
}

@media (max-width: 576px) {
    .badge.rounded-pill {
        min-width: 28px;
        font-size: 0.7rem;
    }
}

/* Color variations for better visual distinction */
.score-breakdown .bg-primary { background-color: #0d6efd !important; }
.score-breakdown .bg-success { background-color: #198754 !important; }
.score-breakdown .bg-info { background-color: #0dcaf0 !important; }
.score-breakdown .bg-warning { background-color: #ffc107 !important; color: #000 !important; }
.score-breakdown .bg-danger { background-color: #dc3545 !important; }
.score-breakdown .bg-secondary { background-color: #6c757d !important; }
.score-breakdown .bg-dark { background-color: #212529 !important; }

/* Responsive adjustments */
@media (max-width: 768px) {
    .score-breakdown {
        padding: 0.75rem;
    }
    
    .score-breakdown .table,
    .score-breakdown .table thead,
    .score-breakdown .table tbody,
    .score-breakdown .table th,
    .score-breakdown .table td,
    .score-breakdown .table tr {
        display: block;
    }
    
    .score-breakdown .table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .score-breakdown .table tr {
        border: none;
        margin-bottom: 0.5rem;
    }
    
    .score-breakdown .table td {
        border: none;
        position: relative;
        padding: 0.5rem 0.75rem 0.5rem 30%;
        text-align: left !important;
        width: 100% !important;
        margin-bottom: 0.25rem;
        background: rgba(248, 249, 250, 0.3);
        border-radius: 8px;
    }
    
    .score-breakdown .table td:before {
        content: attr(data-label) ": ";
        position: absolute;
        left: 6px;
        width: 25%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: 600;
        font-size: 0.7rem;
        color: #6c757d;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .score-breakdown .badge {
        font-size: 0.8rem;
        padding: 0.375rem 0.75rem;
        min-width: 2.5rem;
    }
}

@media (max-width: 576px) {
    .score-breakdown .table td {
        padding: 0.5rem 0.75rem 0.5rem 35%;
    }
    
    .score-breakdown .table td:before {
        width: 30%;
        font-size: 0.65rem;
    }
    
    .score-breakdown .badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
        min-width: 2rem;
    }
}

/* Rating Guide Tooltip Styles */
.rating-guide-container {
    position: relative;
    display: inline-block;
}

.rating-guide-container .form-label {
    cursor: help;
    position: relative;
}

.rating-guide-tooltip {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    background: rgba(33, 37, 41, 0.95);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
    min-width: 280px;
    max-width: 320px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    display: none;
    transform: translateY(-5px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

/* Show tooltip on active state (for mobile click) */
.rating-guide-container.active .rating-guide-tooltip {
    opacity: 1;
    visibility: visible;
    display: block;
    transform: translateY(0);
    pointer-events: auto;
}

/* Desktop hover - more conservative approach */
@media (min-width: 992px) {
    .rating-guide-container:hover .rating-guide-tooltip {
        opacity: 1;
        visibility: visible;
        display: block;
        transform: translateY(0);
        pointer-events: auto;
    }
}

/* Only enable hover on devices that truly support it */
@supports (hover: hover) {
    @media (hover: hover) and (pointer: fine) and (min-width: 992px) {
        .rating-guide-container:hover .rating-guide-tooltip {
            opacity: 1;
            visibility: visible;
            display: block;
            transform: translateY(0);
            pointer-events: auto;
        }
    }
}

.rating-guide-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 20px;
    border: 6px solid transparent;
    border-bottom-color: rgba(33, 37, 41, 0.95);
}

.rating-guide-tooltip .guide-en {
    font-weight: 600;
    margin-bottom: 6px;
    color: #ffc107;
}

.rating-guide-tooltip .guide-zh {
    color: #e9ecef;
    font-size: 0.8rem;
}

.rating-guide-tooltip .score-range {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.2);
    font-size: 0.75rem;
    color: #ced4da;
}

/* Responsive adjustments for mobile */
@media (max-width: 991px) {
    .rating-guide-tooltip {
        min-width: 240px;
        max-width: 280px;
        font-size: 0.8rem;
        padding: 10px 12px;
        right: 0;
        left: auto;
    }
    
    /* Ensure mobile click functionality */
    .rating-guide-container.active .rating-guide-tooltip {
        opacity: 1;
        visibility: visible;
        display: block;
        transform: translateY(0);
        pointer-events: auto;
    }
    
    .rating-guide-tooltip::before {
        right: 15px;
        left: auto;
        border-width: 5px;
    }
}

/* Mobile-optimized review header styles */
.review-header-mobile {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.review-user-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.review-user-info h6 {
    margin: 0;
    font-weight: 600;
    color: #333;
}

.review-date {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 2px;
}

.review-rating-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.review-score {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0d6efd;
    background: #f8f9fa;
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.review-recommendation {
    flex-shrink: 0;
}

/* Desktop responsive adjustments */
@media (min-width: 768px) {
    .review-header-mobile {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .review-rating-section {
        flex-direction: column;
        align-items: flex-end;
        gap: 8px;
        padding: 0;
    }
    
    .review-score {
        font-size: 1rem;
    }
}

/* Mobile action container styles */
.review-action-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.review-action-message {
    flex: 1;
}

.review-action-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

@media (min-width: 576px) {
    .review-action-container {
        flex-direction: row;
        align-items: center;
    }
    
    .review-action-buttons {
        flex-shrink: 0;
    }
}

/* Reviews section mobile width fix */
@media (max-width: 767px) {
    .reviews-section {
        margin: 0 -1rem; /* Extend to full width on mobile */
        padding: 1.5rem;
        border-radius: 0; /* Remove border radius on mobile for full width */
    }
    
    .reviews-section .card {
        margin-left: 0;
        margin-right: 0;
        border-radius: 10px; /* Keep individual cards rounded */
    }
    
    .reviews-section .alert {
        margin-left: 0;
        margin-right: 0;
        border-radius: 10px; /* Keep alerts rounded */
    }
}

/* Ensure consistent container width */
@media (max-width: 576px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .reviews-section {
        margin: 0 -1rem;
        padding: 1rem;
    }
}

/* Desktop layout - keep original horizontal table */
.score-breakdown .table td {
    text-align: center !important;
    vertical-align: middle !important;
    padding: 0.5rem 0.25rem;
}

.score-breakdown .table th {
    text-align: center !important;
    font-size: 0.875rem;
    padding: 0.5rem 0.25rem;
}

.score-breakdown .badge {
    min-width: 32px;
    text-align: center;
    font-weight: 600;
    display: inline-block;
}

/* Mobile layout - vertical list style */
@media (max-width: 767px) {
    .score-breakdown .table-responsive {
        overflow: visible;
    }
    
    .score-breakdown .table {
        display: block;
        width: 100%;
    }
    
    .score-breakdown .table thead {
        display: none; /* Hide table headers on mobile */
    }
    
    .score-breakdown .table tbody {
        display: block;
        width: 100%;
    }
    
    .score-breakdown .table tbody tr {
        display: block;
        width: 100%;
        margin-bottom: 1rem;
        background: #f8f9fa;
        border-radius: 8px;
        padding: 1rem;
    }
    
    .score-breakdown .table tbody tr td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0.5rem 0 !important;
        border: none !important;
        text-align: left !important;
    }
    
    .score-breakdown .table tbody tr td:before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: #666;
        text-transform: uppercase;
        font-size: 0.75rem;
    }
    
    .score-breakdown .table tbody tr td .badge {
        margin-left: auto !important;
        margin-right: 0 !important;
        flex-shrink: 0;
    }
}

/* Simple and clean approach for desktop and mobile */

/* Review content typography improvements */
.card-text {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #2c3e50;
    text-align: justify;
    margin-bottom: 1rem;
}

/* Enhanced review title styling */
.card-title {
    font-family: "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 2px solid #e2e8f0;
    position: relative;
    background: linear-gradient(135deg, #4299e1 0%, #667eea 50%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #4299e1 0%, #667eea 100%);
    border-radius: 2px;
}

/* Paragraph spacing improvements */
.card-text br {
    display: block;
    content: "";
    margin-top: 0.8rem;
}

/* Mobile text improvements */
@media (max-width: 768px) {
    .card-text {
        font-size: 0.9rem;
        line-height: 1.7;
    }
    
    .card-title {
        font-size: 1rem;
    }
}

/* Text selection styling */
.card-text::selection {
    background: #667eea;
    color: white;
}

.card-text::-moz-selection {
    background: #667eea;
    color: white;
}

/* Review paragraph styling */
.review-paragraph {
    margin-bottom: 0.8rem;
    text-indent: 0;
    line-height: 1.7;
}

.review-paragraph:last-child {
    margin-bottom: 0;
}

/* First paragraph specific styling */
.review-paragraph:first-child {
    margin-top: 0;
}

/* Better spacing for Chinese text */
.review-paragraph {
    word-spacing: 0.1em;
    letter-spacing: 0.02em;
}

.review-header-mobile {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.review-rating-section {
  text-align: right;
}

.review-header-mobile {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
}

.review-rating-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-align: right;
}

.review-score {
  font-size: 1.3rem;
  font-weight: 600;
  color: #1976d2;
  background: #fff;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 0.2em 0.7em;
  margin-right: 0.2em;
  display: flex;
  align-items: center;
}

.review-recommendation .badge {
  font-size: 1rem;
  font-weight: 600;
  padding: 0.4em 0.9em;
  border-radius: 12px;
}

@media (max-width: 576px) {
  .review-header-mobile {
    gap: 0.5rem;
  }
  .review-score {
    font-size: 1.1rem;
    padding: 0.15em 0.5em;
  }
  .review-recommendation .badge {
    font-size: 0.95rem;
    padding: 0.3em 0.7em;
  }
}

.score-breakdown .table-responsive,
.score-breakdown .table,
.score-breakdown {
  background: transparent !important;
  box-shadow: none !important;
}

.review-header-mobile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.review-user-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.review-user-info {
  margin-left: 0.5rem;
}

.review-rating-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  text-align: right;
}

@media (max-width: 576px) {
  .review-header-mobile {
    flex-direction: row;
    gap: 0.5rem;
  }
  .review-rating-section {
    gap: 0.3rem;
  }
  .review-user-info {
    margin-left: 0.4rem;
  }
}

.detailed-ratings-card {
  background: #f7f8fa;
  border-radius: 20px;
  box-shadow: none;
}
.detailed-rating-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.7em;
}
.detailed-rating-row:last-child {
  margin-bottom: 0;
}
.detailed-ratings-card .badge {
  font-size: 1.1rem;
  min-width: 2.5em;
  padding: 0.4em 1em;
}

/* User profile link styles */
.review-user-section a {
  transition: transform 0.2s ease;
  text-decoration: none;
}

.review-user-section a:hover {
  transform: scale(1.05);
}

.review-user-section a:hover img,
.review-user-section a:hover div {
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.review-user-info a h6 {
  transition: color 0.2s ease;
}

.review-user-info a:hover h6 {
  color: #667eea !important;
}
