/* ==========================================================================
   VARIABLES & REBOOT
   ========================================================================== */
:root {
    /* Primary Colors */
    --primary-red-500: #ef4444;
    --primary-red-600: #dc2626;
    --primary-pink-400: #f472b6;

    /* Background Colors */
    --background-slate-950: #020617;
    --background-slate-900: #0f172a;
    --background-slate-800: #1e293b;

    /* Accents */
    --accent-yellow-500: #eab308;

    /* Text */
    --text-white: #ffffff;
    --text-gray-300: #d1d5db;

    /* Fonts */
    --heading-font: 'Poppins', sans-serif;
    --body-font: 'Inter', sans-serif;

    /* Effects & Transitions */
    --box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --border: 1px solid rgba(255, 255, 255, 0.1);
    --border2: #cbd5e1 solid 1px;
    --border-radius: 16px;
    --transform: scale(1.03);
}

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

body {
    scrollbar-gutter: stable;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    background-color: var(--background-slate-900);
    color: var(--text-primary);
    transition: background-color 0.3s, color 0.3s;
}

/* ==========================================================================
   UTILITIES & ICONS
   ========================================================================== */
.icon {
    width: 20px;
    height: 20px;
}

.icon-small {
    width: 16px;
    height: 16px;
}

.icon-star {
    width: 14px;
    height: 14px;
    fill: var(--accent-yellow-500);
    color: var(--accent-yellow-500);
    margin-right: 4px;
    vertical-align: middle;
}

/* ==========================================================================
    HEADER
   ========================================================================== */
#header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(to right, var(--background-slate-800), var(--background-slate-950));
    backdrop-filter: blur(4px);
    box-shadow: var(--box-shadow);
    color: var(--text-white);
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    row-gap: 1rem;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Logo */
.logo-icon {
    width: 48px;
    height: 48px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-red-600);
    box-shadow: 0 4px 6px -1px var(--shadow);
    transition: transform 0.6s;
}

.logo-icon img,
.logo-icon .icon-small {
    width: 60%;
    height: 60%;
    object-fit: contain;
}

.logo-text h1 {
    font-size: 1.5rem;
    font-weight: 900;
    color: white;
    letter-spacing: -0.025em;
}

.logo-text .tagline {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 1rem;
    color: #9ca3af;
    max-width: 200px;
}

/* ==========================================================================
    SEARCH & FILTERS
   ========================================================================== */
.search-container {
    position: relative;
    max-width: 400px;
    width: 100%;
    display: flex;
    align-items: center;
    animation: fadeIn 0.6s 0.5s both;
}

.search-input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 3rem;
    border-radius: var(--border-radius);
    background: var(--background-slate-900);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1rem;
    outline: none;
    box-shadow: var(--box-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input:focus {
    border-color: var(--primary-red-500);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.search-icon {
    position: absolute;
    left: 1.2rem;
    width: 18px;
    height: 18px;
    fill: var(--text-gray-300);
    opacity: 0.6;
    pointer-events: none;
    transition: 0.3s ease;
}

.search-input:focus+.search-icon {
    fill: var(--primary-red-500);
    opacity: 1;
}

.filter-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-slate-900);
    color: var(--text-gray-300);
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    box-shadow: var(--box-shadow);
}


/* ==========================================================================
   MAIN CONTENT & GRID
   ========================================================================== */
main {
    padding: 0 1.5rem;
    max-width: 1280px;
    margin: 0 auto;
    animation: fadeIn 0.8s both;
}

.body-header {
    margin: 2rem 1rem;
    color: var(--text-gray-300);
}

.body-header-title {
    font-size: 1.75rem;
    font-weight: 800;
    font-family: var(--heading-font);
    color: var(--text-white);
}

#movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 24px;
    padding: 15px;
}

.movie-card {
    position: relative;
    background: #1e293b;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.movie-card img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    display: block;
}

/* Badges & Overlays */
.trending-badge {
    color: var(--accent-yellow-500);
    display: flex;
    align-items: center;
    gap: 6px;
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    backdrop-filter: blur(4px);
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.icon-trending {
    width: 14px;
    height: 14px;
}

.trending-badge p {
    color: var(--text-white);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px 12px 12px;
    background: linear-gradient(to top, rgba(15, 23, 42, 1) 0%, rgba(15, 23, 42, 0.8) 50%, transparent 100%);
    color: white;
}

.card-info h3 {
    font-size: 0.95rem;
    margin: 0 0 6px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #cbd5e1;
}

/* Disclaimer Section */
.disclaimer-container {
    padding: 1rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.disclaimer-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--background-slate-900);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: var(--border-radius);
    color: var(--text-gray-300);
    font-size: 0.9rem;
    box-shadow: var(--box-shadow);
}

.disclaimer-card .icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: var(--primary-red-500);
}

.disclaimer-header {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.75rem;
}

.icon-disclaimer {
    width: 18px;
    height: 18px;
    fill: var(--primary-red-500);
}

.disclaimer-card a, .footer-bottom a {
    color: var(--primary-red-500);
    text-decoration: none;
    font-weight: 500;
}

.disclaimer-card a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   MODALS & DIALOGS
   ========================================================================== */
#mydialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 90%;
    max-width: 750px;
    max-height: 85vh;
    padding: 0;
    color: #ffffff;
    overflow: hidden;
}

#mydialog::backdrop,
dialog::backdrop {
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(8px);
}

.modal-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(85vh - 80px);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    margin-bottom: 20px;
    background: #000;
}

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

.stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 16px;
    font-weight: 500;
    color: #d1d5db;
}

/* The PG/R Certification Badge */
.certification-badge {
    padding: 0 1rem;
    background: color-mix(in srgb, var(--primary-red-600), transparent 85%);
    color: var(--primary-red-500);
    border-radius: var(--border-radius);
  
}

/* Genre Tags Container */
.modal-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 1.25rem;
}

/* Individual Genre Tag */
.genre-tag {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-gray-300);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    transition: 0.3s;
}

.genre-tag:hover {
    background: var(--primary-red-600);
    color: white;
    border-color: var(--primary-red-600);
}

.modal-rating {
    background-color: rgba(234, 179, 8, 0.2);
    padding: 0 1rem;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    color: var(--accent-yellow-500);
}

.rating-text {
    font-size: 0.75rem;
    color: var(--text-gray-300);
}

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

.close-btn {
    background: rgba(15, 23, 42, 0.95);
    border: none;
    padding: 5px;
    border-radius: var(--border-radius);
    display: flex;
    color: rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

.btn-primary,
.btn-secondary {
    background-color: rgba(19, 109, 168, 0.2);
    color: rgb(103, 178, 228);
    padding: .1rem 1rem;
    border-radius: 2rem;
    border: 1px solid rgba(19, 109, 168, 0.4);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer {
    background: linear-gradient(135deg, #020617 0%, #0f172a 100%);
    color: #ffffff;
    transition: background-color 0.3s ease;
    position: relative;
    width: 100%;
}

.footer-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 4rem 1.5rem 2rem 1.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 2.5rem;
    margin-bottom: 3rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    text-decoration: none;
    color: white;
}

.footer-logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(to bottom right, #f97316, #ef4444);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.footer-logo h3 {
    font-size: 1.5rem;
    font-weight: 900;
    font-family: var(--heading-font);
    letter-spacing: -0.02em;
    background: linear-gradient(to right, var(--primary-red-600), var(--primary-pink-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-desc {
    color: #d1d5db;
    margin-bottom: 1.5rem;
    line-height: 1.7;
    font-size: 0.95rem;
}

.social-links {
    display: flex;
    gap: 0.75rem;
}

.social-link {
    padding: 0.75rem;
    border-radius: 0.75rem;
    background: rgba(255, 255, 255, 0.08);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.footer-title {
    font-weight: 800;
    font-size: 1.125rem;
    margin-bottom: 1.25rem;
    color: var(--text-white);
    font-family: var(--heading-font);
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 0.75rem;
    transition: transform 0.2s ease;
}

.footer-links a {
    text-decoration: none;
    color: var(--text-gray-300);
    font-size: 0.938rem;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #ffffff;
}

.footer-contacts {
    list-style: none;
    padding: 0;
    color: #d1d5db;
}

.footer-contacts li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-contacts .icon {
    width: 20px;
    height: 20px;
    color: #f97316;
    flex-shrink: 0;
    margin-top: 2px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
    color: #9ca3af;
    animation: fadeIn 0.8s 0.4s both;
}

.footer-bottom p {
    font-size: 0.875rem;
    letter-spacing: 0.025em;
}