:root {
    --black: #000000;
    --red: #FF4E4E;
    --white: #F9F9F9;
    --grey: #888888;
    --light-grey: #E0E0E0;
}

.dark-mode {
    --background: var(--black);
    --text: var(--white);
    --card-bg: #1A1A1A;
}

.light-mode {
    --background: var(--white);
    --text: var(--black);
    --card-bg: var(--light-grey);
}

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--background);
    color: var(--text);
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    position: relative;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 75rem;
    margin: 0 auto;
    width: 100%;
    position: relative;
}

.logo {
    max-width: none;
    flex: 1;
    text-align: left;
}

.logo-image {
    width: auto;
    max-height: 3.5rem;
    height: 3.5rem;
    padding-top: 0.4rem;
}

.share-button {
    background: none;
    border: none;
    padding: 0;
    padding-top: 0.2rem;
    padding-right: 1rem;
    cursor: pointer;
}

.share-icon {
    width: 30px;
    height: 30px;
}

.mode-toggle-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    z-index: 1;
}

.mode-toggle {
    display: flex;
    align-items: center;
}

.mode-toggle-label {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    margin: 0 10px;
}

.mode-toggle-label input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mode-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--grey);
    transition: .4s;
    border-radius: 34px;
}

.mode-toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .mode-toggle-slider {
    background-color: var(--red);
}

input:checked + .mode-toggle-slider:before {
    transform: translateX(26px);
}

.mode-toggle-icon {
    font-size: 20px;
}

.movie-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.movie-poster-container {
    width: 100%;
    max-width: 300px;
    aspect-ratio: 2 / 3;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 10px;
}

.movie-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.movie-poster-container:hover .movie-poster {
    transform: scale(1.05);
}

.movie-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.movie-details-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.movie-details-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--grey);
    position: relative;
    display: flex;
    align-items: center;
}

.movie-details-info p:not(:last-child)::after {
    content: "•";
    margin-left: 1rem;
    color: var(--grey);
}

.movie-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.tmdb-logo {
    width: 5.5rem;  /* Using rem instead of pixels */
    height: auto;   /* Height will maintain aspect ratio */
    border-radius: 4px;
}

.movie-description {
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 400;
}

.watch-trailer {
    background-color: var(--red);
    color: var(--white);
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 300;
    text-transform: uppercase;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    align-self: flex-start;
}

.watch-trailer:hover {
    background-color: #ff3030;
}

.section-title {
    font-size: 1rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
}

.streaming-platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.platform-logo-container {
    width: 100px;
    height: 40px;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.platform-logo-container:hover {
    transform: scale(1.05);
}

.platform-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.actors-section, .similar-movies {
    margin-top: 4rem;
}

.actors-section h3, .similar-movies h3 {
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 700;
    font-size: 1.75rem;
}

.actors-container, .similar-movies-container {
    position: relative;
    overflow: hidden;
}

.actors-scroll, .similar-movies-scroll {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 1rem;
}

.actors-scroll::-webkit-scrollbar, .similar-movies-scroll::-webkit-scrollbar {
    display: none;
}

.actor-card, .movie-card {
    flex: 0 0 auto;
    width: 200px;
    margin-right: 1rem;
    background-color: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

.actor-image, .movie-image {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 10px 10px 0 0;
    margin-bottom: 0.5rem;
}

.actor-name, .movie-card h5, .movie-info-small {
    font-size: 1rem;
    margin: 0;
    text-align: left;
    font-weight: 500;
    padding: 0.5rem;
}

.movie-info-small {
    font-size: 0.8rem;
    color: var(--text);
    opacity: 0.7;
}

.scroll-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.scroll-button svg {
    width: 24px;
    height: 24px;
    fill: white;
}

.scroll-left {
    left: 10px;
}

.scroll-right {
    right: 10px;
}

.scroll-left svg {
    transform: rotate(180deg);
}

.bubbles {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.bubble {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--text);
    opacity: 0.3;
    transition: background-color 0.3s ease, opacity 0.3s ease;
}

.bubble.active {
    background-color: var(--red);
    opacity: 1;
}

footer {
    margin-top: 4rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

footer .logo {
    height: 80px;
}

footer p {
    font-size: 1rem;
    margin: 0;
}

footer .image-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

footer .image-button img {
    width: 40px;
    height: 40px;
}

footer .tmdb-credit {
    font-size: 0.8rem;
    color: var(--text);
    opacity: 0.7;
}

@media (min-width: 768px) {
    .movie-details {
        flex-direction: row;
        align-items: flex-start;
        gap: 2rem;
    }

    .movie-poster-container {
        flex: 0 0 400px;
        margin: 0;
        max-width: 400px;
    }

    .movie-info {
        padding-top: 0.5rem;
    }

    .movie-title {
        font-size: 2.5rem;
    }

    .logo {
        height: 80px;
    }

    .mode-toggle-container {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        top: 50%;
        margin-top: -17px;
    }

    .share-icon {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 768px) {
    .mode-toggle-label {
        width: 2.5rem;
        height: 1.4rem;
        margin: 0 0.5rem;
    }

    .mode-toggle-slider:before {
        height: 1.1rem;
        width: 1.1rem;
        left: 0.15rem;
        bottom: 0.15rem;
    }

    input:checked + .mode-toggle-slider:before {
        transform: translateX(1.1rem);
    }

    .mode-toggle-icon {
        font-size: 0.9rem;
    }

    .logo {
        max-width: none;
        flex: 1;
        margin-right: auto;
    }
    
    .logo-image {
        width: auto;
        max-height: 3.5rem;
        height: 3.5rem;
        padding-top: 0.4rem;
    }
    
    nav {
        gap: 1rem;
        padding: 0 1rem;
        display: flex;
        justify-content: flex-start;
        align-items: center;
    }

    .mode-toggle-container {
        display: none;
    }
}

.trailer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 2rem;
    box-sizing: border-box;
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 1200px;
    max-height: calc(100vh - 4rem);
    aspect-ratio: 16/9;
}

.modal-content iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.close-modal {
    position: absolute;
    top: -2rem;
    right: 0;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    z-index: 1001;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
}

.close-modal:hover {
    color: #ddd;
    background: rgba(0, 0, 0, 0.8);
}

.title-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: -0.5rem;
}

.search-icon {
    width: 2rem;
    height: auto;
    cursor: pointer;
    transition: transform 0.2s ease;
    margin-left: 1rem;
}

.search-icon.loading {
    animation: rotate 1s linear infinite;
    opacity: 0.6;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.search-icon:hover {
    transform: scale(1.1);
}

#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.film-reel {
    width: 80px;
    height: 80px;
    position: relative;
    animation: rotate 4s linear infinite;
}

.film-reel::before,
.film-reel::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 8px dashed var(--red);
}

.film-reel::before {
    animation: rotate 4s linear infinite reverse;
}

.film-reel::after {
    width: 40%;
    height: 40%;
    top: 30%;
    left: 30%;
    border: none;
    background: var(--red);
}

.loading-text {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--white);
    font-size: 16px;
    font-weight: bold;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}