/* Root Variables */
:root {
    --primary-color: #e50914;
    --secondary-color: #221f1f;
    --accent-color: #564d4d;
    --text-light: #ffffff;
    --text-dark: #221f1f;
    --bg-dark: #141414;
    --bg-secondary: #221f1f;
    --border-color: #404040;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    width: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Navigation Bar */
.navbar {
    background-color: var(--secondary-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.navbar-brand h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
    font-weight: bold;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(229, 9, 20, 0.4);
    transition: all 0.3s ease;
    cursor: pointer;
    text-transform: uppercase;
    font-family: 'Arial', sans-serif;
}

.navbar-brand h1:hover {
    color: #ff4444;
    text-shadow: 0 4px 15px rgba(229, 9, 20, 0.8);
    transform: scale(1.05);
}

.navbar-search {
    flex: 1;
    min-width: 250px;
    display: flex;
    gap: 0.5rem;
}

.search-box {
    flex: 1;
    padding: 0.7rem 1rem;
    border: 1px solid var(--border-color);
    background-color: var(--bg-dark);
    color: var(--text-light);
    border-radius: 4px;
    font-size: 0.95rem;
}

.search-box:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 8px rgba(229, 9, 20, 0.3);
}

.search-btn {
    padding: 0.7rem 1.5rem;
    background-color: var(--primary-color);
    color: var(--text-light);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.search-btn:hover {
    background-color: #cc0810;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    cursor: pointer;
}

.nav-link:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 500px;
    display: flex;
    align-items: center;
    overflow: hidden;
    margin-bottom: 2rem;
}

.hero-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
    z-index: 0;
}

.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(20, 20, 20, 1) 0%, rgba(20, 20, 20, 0.7) 50%, transparent 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 50%;
    padding: 3rem;
    animation: slideInLeft 0.8s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: bold;
}

.hero-content p {
    font-size: 1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
    color: #ccc;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-light);
}

.btn-primary:hover {
    background-color: #cc0810;
    transform: scale(1.05);
}

.btn-secondary {
    background-color: var(--accent-color);
    color: var(--text-light);
}

.btn-secondary:hover {
    background-color: #6b6060;
}

/* Main Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
    display: grid;
    grid-template-columns: 1fr 250px;
    gap: 2rem;
}

/* Content Section */
.content-section {
    grid-column: 1;
}

.content-section h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    font-weight: bold;
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.movie-card {
    background-color: var(--secondary-color);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
    position: relative;
}

.movie-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 20px rgba(229, 9, 20, 0.3);
}

.movie-poster {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
}

.movie-info {
    padding: 1rem;
}

.movie-title {
    font-weight: bold;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-year {
    font-size: 0.85rem;
    color: #aaa;
    margin-bottom: 0.5rem;
}

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

.rating-badge {
    background-color: var(--primary-color);
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    font-weight: bold;
}

.movie-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.movie-card:hover .movie-card-overlay {
    opacity: 1;
}

.movie-card-overlay button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1rem;
}

/* Sidebar */
.sidebar {
    grid-column: 2;
    height: fit-content;
    position: sticky;
    top: 80px;
}

.filter-group {
    background-color: var(--secondary-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.filter-group h4 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.genre-filters {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.genre-filter {
    display: flex;
    align-items: center;
}

.genre-filter input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

.genre-filter label {
    cursor: pointer;
    flex: 1;
}

.filter-select {
    width: 100%;
    padding: 0.6rem;
    background-color: var(--bg-dark);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
}

.filter-select:hover, .filter-select:focus {
    border-color: var(--primary-color);
}

/* Load More Button */
.load-more-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: var(--text-light);
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.load-more-btn:hover {
    background-color: #cc0810;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--secondary-color);
    border-radius: 8px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease-out;
}

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

.modal-close {
    position: absolute;
    right: 2rem;
    top: 2rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-light);
    z-index: 10;
}

.modal-close:hover {
    color: var(--primary-color);
}

.modal-body {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
    padding: 2rem;
}

.modal-poster {
    width: 100%;
    border-radius: 8px;
}

.modal-info h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.modal-info p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.modal-info .rating span, 
.modal-info .release span,
.modal-info .genres span {
    color: var(--primary-color);
    font-weight: bold;
}

.modal-info .overview {
    color: #ccc;
    font-size: 0.95rem;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.modal-buttons .btn {
    flex: 1;
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999;
}

.loading-spinner.active {
    display: block;
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--secondary-color);
    color: var(--text-light);
    padding: 1rem 1.5rem;
    border-radius: 4px;
    z-index: 1001;
    display: none;
    border-left: 4px solid var(--primary-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
    animation: slideInRight 0.3s ease-out;
}

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

.toast.show {
    display: block;
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--warning-color);
}

/* Footer */
.footer {
    background-color: var(--secondary-color);
    border-top: 1px solid var(--border-color);
    padding: 2rem 1rem;
    text-align: center;
    color: #aaa;
    font-size: 0.9rem;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.footer-version {
    font-weight: 600;
    color: var(--text-light);
}

.footer-divider {
    color: var(--border-color);
}

.footer-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.footer-link:hover {
    color: var(--text-light);
}

@media (max-width: 768px) {
    .footer {
        padding: 1.5rem 1rem;
    }

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

    .footer-divider {
        display: none;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        grid-column: 1;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        position: static;
        height: auto;
    }

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

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

    .navbar-menu {
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .navbar-container {
        flex-direction: column;
        align-items: stretch;
    }

    .navbar-search {
        order: 3;
        width: 100%;
    }

    .navbar-menu {
        order: 2;
        width: 100%;
        justify-content: center;
        gap: 1rem;
    }

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

    .hero-section {
        height: 300px;
        margin-bottom: 1rem;
    }

    .hero-content {
        padding: 1rem;
    }

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

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

    .hero-buttons {
        gap: 0.5rem;
    }

    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .modal-body {
        grid-template-columns: 150px 1fr;
        gap: 1rem;
        padding: 1rem;
    }

    .modal-info h2 {
        font-size: 1.5rem;
    }

    .sidebar {
        grid-template-columns: 1fr;
    }

    .movie-poster {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .navbar-brand h1 {
        font-size: 1.3rem;
    }

    .search-box {
        min-width: 150px;
    }

    .navbar-menu {
        gap: 0.5rem;
        font-size: 0.85rem;
    }

    .grid {
        grid-template-columns: repeat(2, 1fr);
    }

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

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

    .modal-body {
        grid-template-columns: 1fr;
    }

    .modal-poster {
        max-height: 300px;
    }
}

/* Account & List Styles */

/* Auth Modal */
.auth-modal {
    background-color: var(--secondary-color);
    border-radius: 8px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    animation: slideDown 0.3s ease-out;
}

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

.auth-container {
    text-align: center;
}

.auth-container h2 {
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

.auth-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
}

.auth-tab-btn {
    flex: 1;
    padding: 0.8rem;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.auth-tab-btn:hover {
    color: var(--primary-color);
}

.auth-tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.auth-tab {
    display: none;
    animation: fadeIn 0.3s;
}

.auth-tab.active {
    display: block;
}

.auth-input {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    border-radius: 4px;
    font-size: 0.95rem;
}

.auth-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 8px rgba(229, 9, 20, 0.3);
}

.auth-link {
    margin-top: 1rem;
    text-align: center;
}

.auth-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
}

.auth-link a:hover {
    text-decoration: underline;
}

.auth-message {
    margin-top: 1rem;
    min-height: 20px;
    font-size: 0.9rem;
}

/* Account Modal */
.account-modal {
    background-color: var(--secondary-color);
    border-radius: 8px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideDown 0.3s ease-out;
}

.account-container h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.account-container h3 {
    margin: 1.5rem 0 1rem 0;
    color: var(--text-light);
}

.account-container hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1.5rem 0;
}

.account-info {
    background-color: var(--bg-dark);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.account-info p {
    margin: 0.5rem 0;
}

/* Lists Container */
.lists-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.list-item {
    background-color: var(--bg-dark);
    padding: 1rem;
    border-radius: 4px;
    border-left: 3px solid var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s;
}

.list-item:hover {
    background-color: #2d2a2a;
}

.list-header {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.list-name {
    cursor: pointer;
    font-weight: 500;
    transition: color 0.3s;
}

.list-name:hover {
    color: var(--primary-color);
}

.list-rename-input {
    background-color: var(--secondary-color);
    border: 1px solid var(--primary-color);
    color: var(--text-light);
    padding: 0.4rem;
    border-radius: 3px;
    font-size: 0.95rem;
}

.list-actions {
    display: flex;
    gap: 0.5rem;
}

.list-action-btn {
    padding: 0.4rem 0.8rem;
    background-color: var(--primary-color);
    color: var(--text-light);
    border: none;
    border-radius: 3px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.list-action-btn:hover {
    background-color: #cc0810;
}

.list-delete-btn {
    padding: 0.4rem 0.8rem;
    background-color: #dc2626;
    color: var(--text-light);
    border: none;
    border-radius: 3px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.list-delete-btn:hover {
    background-color: #991b1b;
}

/* List Items Container */
.list-items-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.no-items {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--accent-color);
    padding: 2rem;
}

.list-item-card {
    background-color: var(--bg-dark);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.list-item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(229, 9, 20, 0.3);
}

.list-item-poster {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.list-item-no-poster {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--accent-color);
    font-size: 2rem;
}

.list-item-details {
    padding: 0.8rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.list-item-details h4 {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-item-type {
    font-size: 0.8rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.list-item-details button {
    margin-top: auto;
}

.list-item-count {
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Add to List Modal */
.add-to-list-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin: 1.5rem 0;
}

.add-to-list-btn {
    padding: 0.8rem;
    background-color: var(--secondary-color);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
}

.add-to-list-btn:hover:not(:disabled) {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.add-to-list-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: var(--accent-color);
}

/* Button Styles */
.btn-small {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-warning {
    background-color: var(--warning-color);
}

.btn-warning:hover {
    background-color: #d97706;
}

/* Responsive Account Styles */
@media (max-width: 768px) {
    .account-modal {
        max-width: 95%;
        padding: 1.5rem;
    }

    .list-items-container {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .auth-modal {
        max-width: 95%;
        padding: 1.5rem;
    }

    .list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .list-actions {
        width: 100%;
    }

    .list-action-btn,
    .list-delete-btn {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .account-modal {
        max-width: 95%;
        padding: 1rem;
    }

    .list-items-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .auth-tabs {
        flex-direction: column;
        margin-bottom: 1rem;
    }

    .auth-tab-btn {
        border-bottom: none;
        border-left: 3px solid transparent;
        padding-left: 1rem;
    }

    .auth-tab-btn.active {
        border-left-color: var(--primary-color);
        border-bottom: none;
    }
}
