/* ========================================
   MOVIEPLUS - CUSTOM STYLES
   Dark Theme | Mobile-First | Bootstrap 5
   ======================================== */

/* ==================== ROOT VARIABLES ==================== */
:root {
    --primary-color: #dc3545;
    --bg-dark: #0a0a0a;
    --bg-dark-secondary: #141414;
    --bg-card: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --border-color: #2a2a2a;
    --hover-color: #2a2a2a;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    --transition: all 0.3s ease;
}

/* ==================== GLOBAL STYLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #c82333;
}

/* ==================== NAVIGATION BAR ==================== */
.navbar {
    background: linear-gradient(to bottom, rgba(10, 10, 10, 0.9), transparent);
    padding: 1rem 0;
    transition: var(--transition);
    z-index: 1000;
}

.navbar.scrolled {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
}

.navbar-brand {
    font-size: 1.8rem !important;
    letter-spacing: 1px;
}

.navbar-brand i {
    font-size: 2rem;
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary) !important;
}

/* Search Bar */
.search-container {
    position: relative;
}

.search-input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    padding: 0.6rem 2.5rem 0.6rem 1rem;
    border-radius: 25px;
    transition: var(--transition);
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-color);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

/* Mobile Menu */
.navbar-toggler {
    padding: 0.5rem;
}

.navbar-toggler:focus {
    box-shadow: none;
}

/* ==================== HERO SECTION ==================== */
.hero-section {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    background-image: url('https://image.tmdb.org/t/p/original/qJ2tW6WMUDux911r6m7haRef0WH.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    margin-top: 70px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        to right,
        rgba(10, 10, 10, 0.95) 40%,
        rgba(10, 10, 10, 0.7) 70%,
        transparent
    );
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 2rem 0;
}

.hero-content h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.8);
}

.hero-content p {
    max-width: 600px;
    font-size: 1.1rem;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.8);
}

/* ==================== LIVE MATCHES SECTION ==================== */
.live-matches-section {
    background: var(--bg-dark-secondary);
    border-bottom: 1px solid var(--border-color);
}

.matches-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 1rem 0;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.matches-scroll::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.match-card {
    min-width: 250px;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
}

.match-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 8px 20px rgba(220, 53, 69, 0.3);
}

.match-status {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-align: center;
}

.match-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.team img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px;
}

.team span {
    font-size: 0.85rem;
    text-align: center;
    font-weight: 500;
}

.vs-text {
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-secondary);
    padding: 0 0.5rem;
}

/* ==================== CATEGORIES SECTION ==================== */
.categories-section {
    background: var(--bg-dark);
    padding: 2rem 0 !important;
}

.categories-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 1rem 0;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.categories-scroll::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.category-card {
    min-width: 160px;
    height: 100px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.category-card:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.category-card:hover img {
    transform: scale(1.1);
}

.category-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    padding: 1.5rem 1rem 0.8rem;
    display: flex;
    align-items: flex-end;
}

.category-overlay h5 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Active category */
.category-card.active {
    border: 2px solid var(--primary-color);
}

/* ==================== FILTERS SECTION ==================== */
.filters-section {
    background: var(--bg-dark-secondary);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.form-select {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
    padding: 0.6rem 1rem;
    transition: var(--transition);
}

.form-select:focus {
    background-color: var(--bg-card);
    border-color: var(--primary-color);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-select option {
    background-color: var(--bg-card);
    color: var(--text-primary);
}

/* ==================== MOVIE SECTIONS ==================== */
.movies-section {
    padding: 3rem 0;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-title i {
    margin-right: 0.5rem;
}

/* ==================== MOVIE CARDS ==================== */
.movie-card {
    background: var(--bg-card);
    border-radius: 10px;
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.movie-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow);
}

.movie-card-image {
    position: relative;
    overflow: hidden;
    padding-top: 150%; /* 2:3 aspect ratio */
}

.movie-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.movie-card:hover .movie-card-image img {
    transform: scale(1.1);
}

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

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

.play-btn {
    color: var(--text-primary);
    font-size: 3rem;
    transition: var(--transition);
    text-decoration: none;
}

.play-btn:hover {
    color: var(--primary-color);
    transform: scale(1.2);
}

.movie-rating {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(220, 53, 69, 0.9);
    color: var(--text-primary);
    padding: 0.3rem 0.6rem;
    border-radius: 5px;
    font-weight: 600;
    font-size: 0.85rem;
    z-index: 2;
}

.movie-card-body {
    padding: 1rem;
    flex-grow: 1;
}

.movie-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-year {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0;
}

/* ==================== MOVIE DETAILS PAGE ==================== */
.movie-details-section {
    padding-top: 80px;
    min-height: 100vh;
    position: relative;
}

.details-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.1;
    z-index: -1;
}

.movie-poster-large {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.poster-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.movie-poster-large:hover .poster-overlay {
    opacity: 1;
}

.movie-info {
    padding: 2rem 0;
}

/* Cast List */
.cast-list {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 1rem 0;
}

.cast-item {
    text-align: center;
    min-width: 100px;
}

.cast-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #ff6b6b);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    margin: 0 auto 0.5rem;
}

.cast-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Tabs */
.nav-tabs .nav-link {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 1rem 1.5rem;
    border-bottom: 3px solid transparent;
}

.nav-tabs .nav-link:hover,
.nav-tabs .nav-link.active {
    color: var(--text-primary);
    border-bottom-color: var(--primary-color);
    background: transparent;
}

.card {
    border: 1px solid var(--border-color);
}

.card-body {
    padding: 1.5rem;
}

.review-item {
    padding: 1rem 0;
}

/* ==================== FOOTER ==================== */
.footer {
    background: var(--bg-dark-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: 5rem;
}

.footer h3,
.footer h5 {
    color: var(--text-primary);
}

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

.footer a:hover {
    color: var(--primary-color) !important;
}

.social-icons a {
    transition: var(--transition);
}

.social-icons a:hover {
    color: var(--primary-color) !important;
    transform: translateY(-3px);
}

/* ==================== MODALS ==================== */
.modal-content {
    border: 1px solid var(--border-color);
}

.form-control {
    background-color: var(--bg-card);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.form-control:focus {
    background-color: var(--bg-card);
    border-color: var(--primary-color);
    color: var(--text-primary);
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control::placeholder {
    color: var(--text-secondary);
}

.form-check-input {
    background-color: var(--bg-card);
    border-color: var(--border-color);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ==================== BADGES & BUTTONS ==================== */
.badge {
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.btn {
    font-weight: 600;
    border-radius: 5px;
    transition: var(--transition);
}

.btn-danger {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
}

.btn-outline-light:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--text-primary);
    transform: translateY(-2px);
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.movie-card {
    animation: fadeIn 0.5s ease-out;
}

/* Stagger animation for movie cards */
.movie-card:nth-child(1) { animation-delay: 0.1s; }
.movie-card:nth-child(2) { animation-delay: 0.2s; }
.movie-card:nth-child(3) { animation-delay: 0.3s; }
.movie-card:nth-child(4) { animation-delay: 0.4s; }
.movie-card:nth-child(5) { animation-delay: 0.5s; }
.movie-card:nth-child(6) { animation-delay: 0.6s; }

/* Loading Animation */
.loading {
    display: inline-block;
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
}

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

/* ==================== RESPONSIVE STYLES ==================== */

/* Tablets */
@media (max-width: 991px) {
    .hero-section {
        background-attachment: scroll;
    }
    
    .hero-overlay {
        background: linear-gradient(
            to bottom,
            rgba(10, 10, 10, 0.7),
            rgba(10, 10, 10, 0.95)
        );
    }
    
    .hero-content {
        text-align: center;
        padding: 3rem 1rem;
    }
    
    .hero-content p {
        margin: 0 auto 2rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
}

/* Mobile Phones */
@media (max-width: 767px) {
    .navbar-brand {
        font-size: 1.3rem !important;
    }
    
    .hero-section {
        min-height: 60vh;
        margin-top: 60px;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .hero-content p {
        font-size: 0.95rem;
    }
    
    .filters-section {
        position: static !important;
    }
    
    .movie-card-image {
        padding-top: 140%;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .cast-list {
        gap: 0.5rem;
    }
    
    .cast-item {
        min-width: 80px;
    }
    
    .cast-avatar {
        width: 60px;
        height: 60px;
        font-size: 1rem;
    }
    
    /* Live Matches Mobile */
    .match-card {
        min-width: 220px;
    }
    
    .team img {
        width: 40px;
        height: 40px;
    }
    
    .team span {
        font-size: 0.75rem;
    }
    
    /* Categories Mobile */
    .category-card {
        min-width: 140px;
        height: 85px;
    }
    
    .category-overlay h5 {
        font-size: 0.9rem;
    }
}

/* Small Mobile */
@media (max-width: 575px) {
    .search-input {
        font-size: 0.85rem;
        padding: 0.5rem 2rem 0.5rem 0.8rem;
    }
    
    .btn-lg {
        font-size: 0.95rem;
        padding: 0.6rem 1.2rem;
    }
    
    .movie-info {
        padding: 1rem 0;
    }
}

/* ==================== UTILITY CLASSES ==================== */
.text-muted {
    color: var(--text-secondary) !important;
}

.bg-dark {
    background-color: var(--bg-dark) !important;
}

.bg-secondary {
    background-color: var(--hover-color) !important;
}

.border-secondary {
    border-color: var(--border-color) !important;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Image Lazy Loading */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .navbar,
    .filters-section,
    .footer,
    .modal {
        display: none !important;
    }
}