/* Movie Page Styles */

/* Main Layout */
.movie-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px 30px 20px;
    padding-top: 20px;
}

/* Movie Header */
.movie-header {
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.title-container {
    flex-grow: 1;
    flex-shrink: 1;
    min-width: 0;
}

.movie-title {
    font-size: 2.4rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Movie Meta */
.movie-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
    width: auto;
    font-size: 1rem;
    color: #777;
    margin-bottom: 20px;
}

.movie-meta span {
    margin-right: 15px;
    display: inline-flex; /* Align items vertically */
    align-items: center; /* Center items vertically */
}

.meta-group {
    display: flex;
    gap: 15px;
    align-items: center;
}

.movie-meta i {
    margin-right: 5px;
    color: #f5c518;
}

/* Content Rating Styles */
.movie-rating {
    background-color: rgba(70, 70, 70, 0.7);
    color: #fff;
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9rem;
}

.movie-rating.rating-mature {
    background-color: rgba(220, 20, 20, 0.7);
    color: #fff;
    font-weight: 700;
}

/* Rating specific styling to ensure only one star shows */
.rating-icon {
    margin-right: 5px;
    color: #f5c518;
    font-size: 1.1rem;
    display: inline-block; /* Ensure proper display */
}

.movie-rating::before,
.movie-rating::after {
    content: none !important; /* Forcefully prevent any pseudo-elements */
    display: none !important; /* Ensure they don't display */
}

/* Similar movies rating icon */
.movie-overlay .movie-rating {
    font-size: 0.9rem;
}

.movie-overlay .rating-icon {
    font-size: 0.9rem;
}

/* Reset any potential inherited star styles */
.fas.fa-star::before {
    content: "\f005" !important; /* Force the correct star character */
}

.movie-genre {
    background-color: rgba(245, 197, 24, 0.2);
    color: #f5c518;
    padding: 3px 10px;
    border-radius: 4px;
    font-weight: 600;
}

/* Movie Player */
.movie-player {
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 100px;
    position: relative;
    aspect-ratio: 16/9;
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.3);
    position: relative;
    width: 100%;
    margin-bottom: 30px;
}

#player-container {
    width: 100%;
    height: 100%;
    position: relative; /* Ensure child absolute positioning is relative to this */
}

/* Ensure Plyr container maintains proper positioning */
.plyr {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Ensure video maintains its aspect ratio */
.plyr video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* This preserves the video's original aspect ratio */
}

/* Plyr custom styles */
:root {
    --plyr-color-main: #f5c518;
    --plyr-video-control-color: #fff;
    --plyr-video-control-color-hover: #f5c518;
    --plyr-video-control-background-hover: rgba(0, 0, 0, 0.5);
    --plyr-audio-control-background-hover: rgba(0, 0, 0, 0.5);
    --plyr-video-control-radius: 3px;
    --plyr-range-thumb-background: #f5c518;
    --plyr-range-fill-background: #f5c518;
}

.plyr__control--overlaid {
    background: rgba(245, 197, 24, 0.8) !important;
}

.plyr--full-ui input[type=range] {
    color: #f5c518 !important;
}

.plyr__control.plyr__tab-focus,
.plyr__control:hover,
.plyr__control[aria-expanded=true] {
    background: rgba(245, 197, 24, 0.8) !important;
    color: #000 !important;
}

.plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true]::before {
    background: #f5c518 !important;
}

.movie-player video {
    width: 100%;
    height: 100%;
    display: block;
}

/* Movie Description */
.movie-description {
    margin-top: 40px;
    margin-bottom: 40px;
}

.movie-description h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #fff;
}

.movie-description p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #ddd;
    margin-bottom: 20px;
}

.movie-creator {
    margin-top: 30px;
    padding-top: 20px;
}

.movie-creator h3 {
    font-size: 1.2rem;
    color: #f5c518;
    margin-bottom: 10px;
}

.creator-link {
    font-weight: bold;
    color: #f5c518; /* Same gold color as other highlights */
    text-decoration: none;
    transition: color 0.2s ease;
}

.creator-link:hover {
    color: #ffffff;
    text-decoration: underline;
}

.release-date {
    font-size: 0.9rem;
    color: #aaa;
    margin-top: 5px;
}

/* User Rating */
.user-rating {
    margin-bottom: 40px;
}

.user-rating h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #fff;
}

.rating-stars {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.star {
    cursor: pointer;
    font-size: 1.8rem;
    color: #f5c518;
    transition: transform 0.2s ease;
}

.star:hover {
    transform: scale(1.2);
}

.rating-message {
    font-size: 1rem;
    margin-top: 10px;
}

.rating-message.success {
    color: #4caf50;
}

.rating-message.error {
    color: #f44336;
}

/* Similar Movies */
.similar-movies {
    margin-top: 50px;
}

.similar-movies h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #fff;
}

.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
}

.movie-card {
    background-color: rgba(25, 25, 35, 0.6);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.movie-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.movie-thumbnail {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
}

.movie-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.movie-card:hover .movie-thumbnail img {
    transform: scale(1.05);
}

.movie-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    display: flex;
    justify-content: space-between;
}

.movie-card-title {
    padding: 15px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

/* Simple star rating using Unicode */
.simple-rating {
    color: #ccc;
    display: inline-flex;
    align-items: center;
}

.simple-rating::before {
    content: none !important;
}

.simple-rating::after {
    content: none !important;
}

/* Style the Unicode star by targeting its container */
.movie-rating.simple-rating {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Make the star character yellow */
.simple-rating {
    color: #ccc;
}

.simple-rating > ★,
.simple-rating > *:first-child {
    color: #f5c518 !important;
    margin-right: 5px;
    font-size: 1.1rem;
}

.movie-overlay .simple-rating {
    font-size: 0.9rem;
}

/* Remove any previous styles that might cause conflicts */
.rating-icon {
    display: none !important;
}

.fas.fa-star, 
.far.fa-star {
    display: none !important;
}

.fas.fa-star::before,
.far.fa-star::before {
    content: none !important;
}

/* Pure CSS star approach */
.css-star {
    position: relative;
    padding-left: 20px; /* Make room for the star */
    color: #ccc;
}

/* Create the star with a pseudo-element */
.css-star::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background-color: #f5c518;
    clip-path: polygon(
        50% 0%, 
        61% 35%, 
        98% 35%, 
        68% 57%, 
        79% 91%, 
        50% 70%, 
        21% 91%, 
        32% 57%, 
        2% 35%, 
        39% 35%
    );
    display: block;
}

/* Smaller star for movie overlays */
.movie-overlay .css-star {
    padding-left: 15px;
}

.movie-overlay .css-star::before {
    width: 10px;
    height: 10px;
}

/* Hide all previous star styling */
.fas.fa-star, 
.far.fa-star, 
.rating-icon {
    display: none !important;
}

.simple-rating {
    display: none !important;
}

/* Like Button Styling */
.like-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    margin-right: 5px; /* Space between button and count */
    vertical-align: middle; /* Align with text */
    display: inline-flex; /* To contain SVG properly */
    align-items: center;
}

.like-button svg {
    width: 20px; /* Adjust size as needed */
    height: 20px;
    fill: #ccc; /* Default empty heart color */
    transition: fill 0.2s ease;
}

.like-button.liked svg {
    fill: #e74c3c; /* Red heart color when liked */
}

.like-button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.like-count {
    font-weight: bold;
    vertical-align: middle; /* Align with button */
    display: inline-flex; /* Keep it inline */
    align-items: center;
}

.like-count-display {
    display: inline-flex; /* Keep icon and count together */
    align-items: center;
    vertical-align: middle;
}

.like-count-display svg {
    width: 20px;
    height: 20px;
    margin-right: 5px;
    fill: #ccc; /* Greyed out icon for display only */
}

/* Styles for Like Section above player */
.movie-like-section {
    position: absolute;
    top: 15px; 
    right: 15px; 
    z-index: 10; 
    display: flex;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    flex-shrink: 0; 
}

/* Show like section on player hover */
#player-container:hover .movie-like-section {
    opacity: 1;
    visibility: visible;
}

/* Adjust size/style for overlay */
.movie-like-section .like-button {
    margin-right: 8px; 
    background: none; /* Ensure no button background */
    border: none;
    padding: 0;
}

.movie-like-section .like-button svg {
    width: 36px; /* Increased size */
    height: 36px;
    fill: #FF4136; /* Brighter red */
    transition: opacity 0.2s ease; 
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5)); 
}

.movie-like-section .like-button.liked svg {
    fill: #FF4136; /* Brighter red (ensure liked state also uses it) */
}

.movie-like-section .like-count {
    font-size: 1.3em; /* Increased size */
    font-weight: bold;
    color: #fff; 
    text-shadow: 0 1px 2px rgba(0,0,0,0.7); /* Add shadow for visibility */
}

.movie-like-section .like-count-display {
    display: flex;
    align-items: center;
}

.movie-like-section .like-count-display svg {
    width: 36px; /* Increased size */
    height: 36px;
    margin-right: 8px;
    fill: #FF4136; /* Brighter red for display-only */
    opacity: 0.7; 
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
}

.movie-like-section .like-count-display #like-count {
    font-size: 1.3em; /* Increased size */
    font-weight: bold;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.7);
}

/* Ensure player controls don't overlap - Adjust if needed */
.plyr__controls {
    padding-right: 70px; /* Increased padding slightly due to larger icon */
}

/* Cleanup previous header styles if they conflict */
/* .movie-header .movie-like-section { ... } */

/* Alert for pending movies should be full width */
.movie-header .alert {
    flex-basis: 100%;
    margin-top: 15px;
    order: 3;
} 