:root {
    --primary-color: #5145ff;
    --primary-light: #7a72ff;
    --primary-dark: #3d33cc;
    --accent-color: #ff4081;
    --text-light: #f8f9fa;
    --text-dark: #212529;
    --bg-light: #ffffff;
    --bg-dark: #121212;
    --bg-card-light: #f8f9fa;
    --bg-card-dark: #1e1e1e;
    --border-light: #e0e0e0;
    --border-dark: #333333;
    --shadow-light: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-dark: 0 4px 12px rgba(0, 0, 0, 0.3);
    
    --dynamic-primary: #5145ff;
    --dynamic-primary-light: #7a72ff;
    --dynamic-primary-dark: #3d33cc;
    --dynamic-accent: #ff4081;
    --dynamic-text: #f8f9fa;
    --dynamic-bg: rgba(10, 10, 30, 0.8);
    
    --container-padding: 5%;
    --container-max-width: 1400px;
    --border-radius-sm: 4px;
    --border-radius-md: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 24px;
    
    --transition-fast: all 0.2s ease;
    --transition-normal: all 0.3s ease;
    --transition-slow: all 0.5s ease;

    --initial-loader-bg: #121212;
    --loader-text-color: #f8f9fa;
    --logo-text-color: #f8f9fa;
    --loading-bar-bg: rgba(255, 255, 255, 0.1);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    transition: var(--transition-normal);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.loading {
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--container-padding);
}

img {
    max-width: 100%;
    height: auto;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-normal);
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: none;
    transition: var(--transition-normal);
}

ul {
    list-style: none;
}

body.light-mode {
    background-color: var(--bg-light);
    color: var(--text-dark);
}

body.dark-mode {
    background-color: var(--bg-dark);
    color: var(--text-light);
}

.initial-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.initial-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--initial-loader-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.initial-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

.logo-animation {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--dynamic-primary);
}

.logo-animation .highlight {
    color: var(--dynamic-primary);
}

.loader-text {
    color: var(--loader-text-color);
    margin-top: 1rem;
    font-size: 0.9rem;
    opacity: 0.7;
    letter-spacing: 1px;
}

.loading-bar {
    width: 300px;
    height: 4px;
    background-color: var(--loading-bar-bg);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.loading-progress {
    height: 100%;
    width: 0%;
    background-color: var(--dynamic-primary);
    animation: loading 1s ease-in-out forwards;
}

@keyframes loading {
    0% { width: 0; }
    100% { width: 100%; }
}

header {
    position: sticky;
    top: 0;
    z-index: 100;
}

body.light-mode header {
    background-color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
}

body.dark-mode header {
    background-color: rgba(18, 18, 18, 0.85);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    max-width: var(--container-max-width);
    margin: 0 auto;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--dynamic-primary);
    transition: color 0.5s ease;
    position: relative;
}

.search-container {
    display: flex;
    flex: 0 1 400px;
    margin: 0 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-radius: 50px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.search-container:focus-within {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

body.dark-mode .search-container {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

body.dark-mode .search-container:focus-within {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

input[type="text"] {
    padding: 0.75rem 1.25rem;
    border-radius: 50px 0 0 50px;
    border: none;
    width: 100%;
    font-family: inherit;
    font-size: 0.9rem;
    transition: var(--transition-normal);
}

body.light-mode input[type="text"] {
    background-color: #f4f4f4;
    color: var(--text-dark);
}

body.dark-mode input[type="text"] {
    background-color: #2a2a2a;
    color: var(--text-light);
}

input[type="text"]:focus {
    outline: none;
}

#search-btn {
    background-color: var(--dynamic-primary);
    color: white;
    border: none;
    padding: 0 1.25rem;
    border-radius: 0 50px 50px 0;
    transition: background-color 0.5s ease;
}

#search-btn:hover {
    background-color: var(--dynamic-primary-dark);
}

.nav-controls {
    display: flex;
    align-items: center;
}

#theme-toggle {
    background: none;
    border: none;
    font-size: 1.25rem;
    margin-right: 1.5rem;
    transition: var(--transition-normal);
    color: inherit;
    opacity: 0.8;
}

#theme-toggle:hover {
    opacity: 1;
}

.menu {
    display: flex;
    list-style: none;
}

.menu li a {
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition-normal);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
}

body.light-mode .menu li a {
    color: var(--text-dark);
}

body.dark-mode .menu li a {
    color: var(--text-light);
}

.menu li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--dynamic-primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.menu li a:hover::after {
    width: 0;
}

.menu li a.active {
    color: var(--dynamic-primary);
    font-weight: 600;
    transition: color 0.5s ease;
}

.menu li a.active::after {
    width: 70%;
}

.menu li a:focus {
    outline: none;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    height: 20px;
    cursor: pointer;
}

.menu-toggle span {
    width: 25px;
    height: 2px;
    background-color: var(--text-dark);
    transition: var(--transition-normal);
}

body.dark-mode .menu-toggle span {
    background-color: var(--text-light);
}

.hero-section {
    position: relative;
    height: 70vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 5%;
    overflow: hidden;
    margin-bottom: 3rem;
    color: white;
}

.hero-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(var(--dynamic-bg), var(--dynamic-bg)), 
                url('https://image.tmdb.org/t/p/original/uDgy6hyPd82kOHh6I95FLtLnj6p.jpg') center/cover no-repeat;
    z-index: -1;
    transition: var(--transition-slow);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.7) 30%, transparent);
    z-index: -1;
}

.hero-content {
    max-width: 600px;
    z-index: 1;
}

.hero-content h2 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    line-height: 1.1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    display: inline-block;
}

.hero-content h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100px;
    height: 4px;
    background: linear-gradient(to right, var(--dynamic-primary), var(--dynamic-accent));
    border-radius: 2px;
}

.hero-content p {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    opacity: 0.9;
    max-width: 90%;
}

.call-to-action {
    background: linear-gradient(to right, var(--dynamic-primary), var(--dynamic-primary-light));
    color: white;
    padding: 0.85rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s;
    border: none;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.call-to-action:hover {
    background: linear-gradient(to right, var(--dynamic-primary-dark), var(--dynamic-primary));
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.hero-credits {
    position: absolute;
    bottom: 20px;
    right: 30px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    background-color: rgba(0, 0, 0, 0.3);
    display: none;
}

.filter-section {
    padding: 0 0 2rem;
}

.filter-container {
    background-color: var(--bg-card-light);
    padding: 1.8rem;
    border-radius: var(--border-radius-lg);
    margin-bottom: 2rem;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-light);
}

body.dark-mode .filter-container {
    background-color: var(--bg-card-dark);
    box-shadow: var(--shadow-dark);
}

.filter-container h3 {
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    position: relative;
    display: inline-block;
}

.filter-container h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(to right, var(--dynamic-primary), var(--dynamic-accent));
    border-radius: 1.5px;
    transition: background-color 0.5s ease;
}

.filters-flex {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.genres-container {
    flex: 1 1 60%;
}

.year-filter {
    flex: 1 1 30%;
    min-width: 200px;
}

.filter-container h4 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-hint {
    font-size: 0.8rem;
    font-weight: normal;
    opacity: 0.7;
    cursor: help;
    position: relative;
}

.date-hint::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--dynamic-primary);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 10;
    width: max-content;
    pointer-events: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.date-hint:hover::before {
    opacity: 1;
    visibility: visible;
    bottom: calc(100% + 5px);
}

.genre-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.genre-pill {
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

body.light-mode .genre-pill {
    background-color: #f5f5f5;
}

body.dark-mode .genre-pill {
    background-color: #2a2a2a;
    border-color: var(--border-dark);
}

.genre-pill:hover {
    border-color: var(--dynamic-primary-light);
}

.genre-pill.active {
    background: linear-gradient(to right, var(--dynamic-primary), var(--dynamic-primary-light));
    color: white;
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(81, 69, 255, 0.3);
}

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

#year-slider {
    flex: 1;
    appearance: none;
    height: 6px;
    background: #ddd;
    border-radius: 3px;
    outline: none;
}

body.dark-mode #year-slider {
    background: #444;
}

#year-slider::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--dynamic-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

#selected-year {
    font-weight: 600;
    min-width: 60px;
    text-align: center;
    padding: 0.3rem 0.8rem;
    background-color: var(--dynamic-primary);
    color: white;
    border-radius: 50px;
    font-size: 0.9rem;
}

.featured-section {
    padding: 2rem 0 4rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.section-header h2 {
    font-size: 2.2rem;
    font-weight: 600;
    position: relative;
    display: inline-block;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, var(--dynamic-primary), var(--dynamic-accent));
    border-radius: 1.5px;
    transition: background-color 0.5s ease;
}

.view-controls {
    display: flex;
    gap: 0.8rem;
}

.view-btn {
    width: 45px;
    height: 45px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-card-light);
    color: var(--text-dark);
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

body.dark-mode .view-btn {
    background-color: var(--bg-card-dark);
    color: var(--text-light);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.view-btn.active {
    background: linear-gradient(to right, var(--dynamic-primary), var(--dynamic-primary-light));
    color: white;
}

.view-btn:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body.dark-mode .view-btn:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 2.5rem;
    margin-bottom: 2rem;
}

.movies-list {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.movie-card {
    position: relative;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
    height: 100%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    background-color: var(--bg-card-light);
}

body.dark-mode .movie-card {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    background-color: var(--bg-card-dark);
}

.movie-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.movie-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    transition: transform 0.3s;
}

.movie-card:hover .movie-poster {
    transform: scale(1.01);
}

.movie-info {
    padding: 1.2rem;
    position: relative;
}

.movie-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(to right, var(--dynamic-primary), var(--dynamic-accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s;
}

.movie-card:hover::after {
    transform: scaleX(1);
}

.movie-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.7rem;
    line-height: 1.3;
    display: flex;
    justify-content: space-between;
}

.viewed-badge {
    color: var(--dynamic-primary);
    font-size: 1rem;
}

.movie-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #777;
}

.movie-rating {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.movie-rating i {
    color: #ffc107;
}

.movie-list-item {
    display: flex;
    background-color: var(--bg-card-light);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

body.dark-mode .movie-list-item {
    background-color: var(--bg-card-dark);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.movie-list-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.movie-list-poster {
    width: 120px;
    min-width: 120px;
    height: 180px;
    object-fit: cover;
    transition: transform 0.3s;
}

.movie-list-item:hover .movie-list-poster {
    transform: scale(1.01);
}

.movie-list-info {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
}

.movie-list-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.8rem;
}

.movie-list-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.movie-list-overview {
    font-size: 0.95rem;
    margin-bottom: 1.2rem;
    opacity: 0.8;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

.movie-list-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #777;
}

.movie-list-meta .movie-genre {
    margin-right: 0.5rem;
    font-size: 0.85rem;
    opacity: 0.8;
}

.loading {
    display: block;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(81, 69, 255, 0.1);
    border-top-color: var(--dynamic-primary);
    border-right-color: var(--dynamic-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transition: border-top-color 0.5s ease;
    box-shadow: 0 0 20px rgba(81, 69, 255, 0.2);
}

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

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 3rem 0 1rem;
    gap: 1.5rem;
}

#prev-page, #next-page {
    background: linear-gradient(to right, var(--dynamic-primary), var(--dynamic-primary-light));
    color: white;
    border: none;
    padding: 0.85rem 1.8rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

#prev-page:hover, #next-page:hover {
    background: linear-gradient(to right, var(--dynamic-primary-dark), var(--dynamic-primary));
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

#prev-page:disabled, #next-page:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

#current-page {
    font-weight: 500;
    background-color: var(--bg-card-light);
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    min-width: 180px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

body.dark-mode #current-page {
    background-color: var(--bg-card-dark);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    position: relative;
    margin: 5% auto;
    width: 92%;
    max-width: 1100px;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    animation: modalFadeIn 0.3s;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}

body.light-mode .modal-content {
    background-color: var(--bg-light);
    color: var(--text-dark);
}

body.dark-mode .modal-content {
    background-color: var(--bg-dark);
    color: var(--text-light);
}

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

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    background: rgba(0, 0, 0, 0.5);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-backdrop {
    height: 450px;
    position: relative;
    background-size: cover;
    background-position: center;
    transition: background-image 0.5s ease;
}

.modal-backdrop::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, var(--dynamic-bg), var(--bg-dark));
    opacity: 0.9;
    transition: background 0.5s ease;
}

.modal-poster {
    position: absolute;
    bottom: -120px;
    left: 60px;
    width: 220px;
    border-radius: var(--border-radius-md);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    transition: all 0.3s;
    transform-origin: bottom left;
    border: 4px solid rgba(255, 255, 255, 0.1);
}

.modal-details {
    padding: 2.5rem;
    padding-top: 140px;
}

.modal-title {
    font-size: 2.2rem;
    margin-bottom: 1.2rem;
    position: relative;
    display: inline-block;
}

.modal-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, var(--dynamic-primary), var(--dynamic-accent));
    border-radius: 1.5px;
    transition: background-color 0.5s ease;
}

.modal-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    font-size: 1rem;
    flex-wrap: wrap;
}

.modal-meta span {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.modal-meta i {
    color: var(--dynamic-primary);
}

.modal-overview {
    margin-bottom: 2.5rem;
    line-height: 1.8;
}

.modal-overview p {
    font-size: 1.05rem;
}

.modal-genres {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.modal-genre {
    background: linear-gradient(to right, var(--dynamic-primary), var(--dynamic-primary-light));
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-size: 0.9rem;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.modal-genre:hover {
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.12);
}

.modal-section-title {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
    font-weight: 600;
    font-size: 1.3rem;
}

.modal-section-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 35px;
    height: 2px;
    background: linear-gradient(to right, var(--dynamic-primary), var(--dynamic-accent));
    border-radius: 1px;
    transition: background-color 0.5s ease;
}

.trailer-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    margin-bottom: 2.5rem;
    border-radius: var(--border-radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.trailer-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.cast-card {
    border-radius: var(--border-radius-md);
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.cast-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

body.light-mode .cast-card {
    background-color: #f4f4f4;
}

body.dark-mode .cast-card {
    background-color: #2a2a2a;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.cast-img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    transition: transform 0.3s;
}

.cast-card:hover .cast-img {
    transform: scale(1.02);
}

.cast-info {
    padding: 1rem;
}

.cast-name {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
}

.cast-character {
    font-size: 0.85rem;
    color: #777;
}

.toast-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 350px;
}

.toast {
    background: linear-gradient(to right, var(--dynamic-primary), var(--dynamic-primary-light));
    color: white;
    padding: 1.2rem;
    border-radius: var(--border-radius-md);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    animation: toastIn 0.3s forwards;
    display: flex;
    align-items: center;
    gap: 15px;
}

.toast.error {
    background: linear-gradient(to right, #e74c3c, #c0392b);
}

.toast.success {
    background: linear-gradient(to right, #2ecc71, #27ae60);
}

.toast i {
    font-size: 1.5rem;
}

@keyframes toastIn {
    from {transform: translateX(100%); opacity: 0;}
    to {transform: translateX(0); opacity: 1;}
}

@keyframes toastOut {
    from {transform: translateX(0); opacity: 1;}
    to {transform: translateX(100%); opacity: 0;}
}

.skeleton {
    position: relative;
    overflow: hidden;
    background-color: #f0f0f0;
    border-radius: var(--border-radius-md);
}

body.dark-mode .skeleton {
    background-color: #2a2a2a;
}

.skeleton::after {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    animation: sweep 1.5s infinite;
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.2) 20%,
        rgba(255, 255, 255, 0.5) 60%,
        rgba(255, 255, 255, 0)
    );
}

body.dark-mode .skeleton::after {
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.1) 20%,
        rgba(255, 255, 255, 0.2) 60%,
        rgba(255, 255, 255, 0)
    );
}

@keyframes sweep {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.skeleton-card {
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    height: 100%;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

body.dark-mode .skeleton-card {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.skeleton-poster {
    width: 100%;
    aspect-ratio: 2/3;
}

.skeleton-title {
    height: 22px;
    margin: 1.2rem 1.2rem 0.7rem;
    width: 80%;
}

.skeleton-meta {
    height: 16px;
    margin: 0 1.2rem 1.2rem;
    width: 60%;
}

footer {
    margin-top: auto;
    padding: 4rem 0 1.5rem;
    transition: var(--transition-normal);
}

body.light-mode footer {
    background-color: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

body.dark-mode footer {
    background-color: #1a1a1a;
    border-top: 1px solid #333;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-logo h3 {
    font-size: 1.8rem;
    margin-bottom: 0.8rem;
    position: relative;
    display: inline-block;
}

.footer-logo span {
    color: var(--dynamic-primary);
    transition: color 0.5s ease;
}

.footer-links h4, .footer-social h4 {
    margin-bottom: 1.2rem;
    font-size: 1.2rem;
    position: relative;
    display: inline-block;
}

.footer-links h4::after, .footer-social h4::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 30px;
    height: 2px;
    background: linear-gradient(to right, var(--dynamic-primary), var(--dynamic-accent));
    border-radius: 1px;
}

.footer-links ul li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    position: relative;
    padding-left: 0;
    transition: padding-left 0.3s ease;
}

.footer-links a:hover {
    color: var(--dynamic-primary);
}

body.dark-mode .footer-links a:hover {
    color: var(--dynamic-primary);
}

body.light-mode .footer-links a:hover {
    color: var(--dynamic-primary);
}

body.light-mode .footer-links a {
    color: var(--text-dark);
}

body.dark-mode .footer-links a {
    color: var(--text-light);
}

.social-icons {
    display: flex;
    gap: 1.2rem;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: rgba(81, 69, 255, 0.1);
    transition: all 0.3s;
    font-size: 1.2rem;
}

.social-icons a:hover {
    background: linear-gradient(to right, var(--dynamic-primary), var(--dynamic-primary-light));
    color: white;
    box-shadow: 0 3px 10px rgba(81, 69, 255, 0.2);
}

.footer-attribution {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.footer-attribution img {
    height: 35px;
    transition: transform 0.3s ease;
}

.footer-attribution img:hover {
    transform: scale(1.02);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.8rem;
    font-size: 0.9rem;
    color: #777;
    border-top: 1px solid;
}

body.light-mode .footer-bottom {
    border-color: #e0e0e0;
}

body.dark-mode .footer-bottom {
    border-color: #333;
}

::-webkit-scrollbar {
    display: none;
}

.error-message {
    text-align: center;
    padding: 2rem;
    background-color: var(--bg-card-light);
    border-radius: var(--border-radius-lg);
    margin: 2rem 0;
    font-size: 1.1rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--dynamic-primary);
}

body.dark-mode .error-message {
    background-color: var(--bg-card-dark);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.no-results {
    text-align: center;
    padding: 3rem;
    background-color: var(--bg-card-light);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    margin: 2rem 0;
    font-size: 1.2rem;
    line-height: 1.8;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

body.dark-mode .no-results {
    background-color: var(--bg-card-dark);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.no-results i {
    font-size: 3rem;
    color: var(--dynamic-primary);
    margin-bottom: 1rem;
}

.menu li a:focus {
    outline: none;
}

.movie-rating-large {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 1;
    border: 2px solid var(--dynamic-primary);
}

.movie-rating-large i {
    color: #ffc107;
    font-size: 0.8rem;
    margin-right: 2px;
}

[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(to right, var(--dynamic-primary), var(--dynamic-primary-light));
    color: white;
    padding: 0.6rem 1rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 10;
    width: max-content;
    max-width: 250px;
    pointer-events: none;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: calc(125% + 5px);
}

@media (max-width: 1200px) {
    .hero-content h2 {
        font-size: 3rem;
    }
}

@media (max-width: 992px) {
    .menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background-color: var(--bg-light);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        padding: 1rem 0;
        animation: menuSlideDown 0.3s ease;
    }

    @keyframes menuSlideDown {
        from {opacity: 0; transform: translateY(-10px);}
        to {opacity: 1; transform: translateY(0);}
    }

    body.dark-mode .menu {
        background-color: var(--bg-dark);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }

    .menu.show {
        display: flex;
    }

    .menu li {
        width: 100%;
    }

    .menu li a {
        display: block;
        padding: 1rem 2rem;
        border-radius: 0;
    }

    .menu li a::after {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .hero-section {
        height: 60vh;
    }

    .hero-content h2 {
        font-size: 2.5rem;
    }

    .hero-content p {
        font-size: 1.1rem;
    }

    .modal-poster {
        width: 180px;
        bottom: -90px;
        left: 40px;
    }

    .modal-backdrop {
        height: 350px;
    }

    .modal-details {
        padding-top: 110px;
    }
}

@media (max-width: 768px) {
    .hero-section {
        height: 55vh;
    }

    .hero-content h2 {
        font-size: 2.2rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    nav {
        flex-wrap: wrap;
    }

    .logo {
        order: 1;
    }

    .nav-controls {
        order: 2;
    }

    .search-container {
        order: 3;
        flex: 0 0 100%;
        margin: 1rem 0 0;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1.5rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 2.5rem;
    }

    .modal-poster {
        position: relative;
        bottom: 0;
        left: 0;
        width: 140px;
        margin: -70px 0 0 30px;
        border-width: 3px;
    }

    .modal-details {
        padding-top: 1.5rem;
    }

    .modal-title {
        font-size: 1.8rem;
    }
    
    .filters-flex {
        flex-direction: column;
        gap: 1.5rem;
    }
}

@media (max-width: 576px) {
    .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1.2rem;
    }

    .hero-section {
        height: 50vh;
        text-align: center;
        justify-content: center;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-content h2 {
        font-size: 2rem;
    }

    .hero-content h2::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .hero-content p {
        font-size: 0.95rem;
        margin-left: auto;
        margin-right: auto;
    }

    .modal-meta {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .modal-backdrop {
        height: 250px;
    }
    
    .modal-poster {
        width: 120px;
        margin: -60px 0 0 20px;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    #current-page {
        order: -1;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .modal-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 1rem;
    }
    
    .cast-name, .cast-character {
        font-size: 0.8rem;
    }
    
    .modal-title {
        font-size: 1.5rem;
    }
    
    .modal-overview p {
        font-size: 0.95rem;
    }
    
    .toast {
        padding: 0.8rem;
        max-width: 300px;
    }
    
    .footer-bottom {
        font-size: 0.8rem;
    }
}