/* ============================
   GLOBAL
============================ */
body {
    background: #0d0f14;
    color: white;
    font-family: Arial, sans-serif;
    margin: 0;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
}

/* ============================
   NAVBAR
============================ */
.navbar {
    background: #020916;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 999;
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    color: #00b4e4;
    text-decoration: none;
}

.nav-links a {
    margin: 0 14px;
    color: #d0d0d0;
    text-decoration: none;
    font-size: 15px;
}

.nav-links a:hover {
    color: #00b4e4;
}

/* ============================
   HERO SECTION (HOME)
============================ */
.home-hero {
    height: 260px;
    background: linear-gradient(to bottom, #0d0f14, #0d0f14);
    display: flex;
    align-items: center;
}

.home-hero-content h1 {
    font-size: 38px;
    font-weight: 700;
}

/* ============================
   TMDB ROWS (HOME)
============================ */
.tmdb-row {
    margin: 40px 0;
}

.tmdb-row-title {
    font-size: 22px;
    margin-bottom: 16px;
}

.tmdb-row-container {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding-bottom: 10px;
}

.movie-card {
    width: 150px;
    flex-shrink: 0;
    text-decoration: none;
    color: white;
}

.movie-card img {
    width: 100%;
    border-radius: 10px;
}

.movie-title {
    margin-top: 6px;
    font-size: 14px;
}

.movie-rating {
    font-size: 13px;
    color: #9aa0a6;
}

/* ============================
   MOVIE PAGE
============================ */
.poster {
    width: 300px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.container h1 {
    margin-bottom: 20px;
}

.container h2 {
    margin-top: 40px;
    margin-bottom: 10px;
}

/* Cast grid */
.cast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
}

/* Recommendations */
.rec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.rec-grid img {
    width: 100%;
    border-radius: 10px;
}

.rec-grid p {
    margin-top: 6px;
    font-size: 14px;
}

/* ============================
   PERSON PAGE
============================ */
.person-page {
    padding-top: 40px;
}

.person-header {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
}

.person-photo img {
    width: 260px;
    border-radius: 12px;
}

.person-info h1 {
    font-size: 36px;
}

.person-info p {
    color: #cfcfcf;
    line-height: 1.6;
}

.person-info h2 {
    margin-top: 20px;
    font-size: 22px;
}

/* Known For */
.tmdb-row-container {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding-bottom: 20px;
}

/* Filmography */
.filmography {
    margin-top: 20px;
}

.filmography-item {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    justify-content: space-between;
    color: #d0d0d0;
}

.filmography-item a {
    color: white;
    text-decoration: none;
}

.filmography-item span {
    color: #9aa0a6;
}

/* ============================
   SEARCH PAGE
============================ */
.search-page h1 {
    margin: 30px 0;
}

.search-bar-wrapper {
    margin: 40px 0 20px 0;
}

.search-bar {
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid #1f2937;
    background: #0d1117;
    color: white;
    font-size: 16px;
}

/* Autocomplete */
.autocomplete-dropdown {
    position: absolute;
    background: #0d1117;
    border: 1px solid #1f2937;
    width: 100%;
    margin-top: 4px;
    border-radius: 6px;
    display: none;
    z-index: 1000;
}

.auto-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    text-decoration: none;
    color: white;
}

.auto-item img {
    width: 40px;
    height: 60px;
    border-radius: 4px;
    object-fit: cover;
}

/* Search results grid */
.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 24px;
}

.search-card {
    text-decoration: none;
    color: white;
}

.search-card img {
    width: 100%;
    border-radius: 10px;
}

.search-title {
    margin-top: 8px;
    font-size: 15px;
}

.search-type {
    font-size: 13px;
    color: #9aa0a6;
}

/* ============================
   MOVIE PAGE — TIGHTENED
============================ */
.movie-page {
    padding-top: 40px;
}

.movie-hero {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
}

.movie-hero-left {
    flex-shrink: 0;
}

.movie-hero-poster {
    width: 320px;
    border-radius: 12px;
}

.movie-hero-right {
    flex: 1;
}

.movie-hero-right h1 {
    font-size: 34px;
    margin-bottom: 10px;
}

.movie-meta {
    display: flex;
    gap: 10px;
    color: #9aa0a6;
    margin-bottom: 20px;
    font-size: 15px;
}

.movie-hero-right h2 {
    margin-top: 25px;
    margin-bottom: 8px;
}

.cast-item {
    text-decoration: none;
    color: white;
    display: block;
}
.cast-item img {
    width: 100%;
    border-radius: 8px;
}
.cast-item p {
    margin-top: 6px;
}

.logo {
    font-size: 26px;
    font-weight: 700;
    color: #00b4e4;
    text-decoration: none;
}

.nav-links a {
    margin-left: 20px;
    font-size: 16px;
}

.autocomplete-dropdown {
    position: absolute;
    background: #0d1117;
    border: 1px solid #1f2937;
    width: 100%;
    margin-top: 4px;
    border-radius: 6px;
    display: none;
    z-index: 1000;
}

.autocomplete-dropdown * {
    pointer-events: auto;
}

.search-bar {
    position: relative;
}

.search-bar input {
    position: relative;
    z-index: 2;
}

/* ============================
   CARD DASHBOARD
============================ */

.stats-page h1 {
    margin-bottom: 30px;
    font-size: 32px;
}

.stats-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stats-card {
    background: #111827;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #1f2937;
}

.stats-card-label {
    font-size: 15px;
    color: #9ca3af;
    margin-bottom: 8px;
}

.stats-card-number {
    font-size: 32px;
    font-weight: bold;
    color: #00b4e4;
}

.stats-list {
    margin-top: 20px;
    border: 1px solid #1f2937;
    border-radius: 10px;
    overflow: hidden;
}

.stats-list-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #1f2937;
}

.stats-list-item:last-child {
    border-bottom: none;
}

.autocomplete-dropdown {
    position: absolute;
    background: #0d1117;
    border: 1px solid #1f2937;
    width: 100%;
    margin-top: 4px;
    border-radius: 6px;
    display: none;
    z-index: 1000;
}

.search-bar {
    position: relative;
}

.search-bar input {
    position: relative;
    z-index: 2;
}

.stats-page h1 {
    margin-bottom: 30px;
    font-size: 32px;
}

.stats-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stats-card {
    background: #111827;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #1f2937;
}

.stats-card-label {
    font-size: 15px;
    color: #9ca3af;
    margin-bottom: 8px;
}

.stats-card-number {
    font-size: 22px;
    font-weight: bold;
    color: #00b4e4;
}

.movie-card,
.person-card {
    display: flex;
    flex-direction: column;
    width: 150px;
    text-decoration: none;
    color: white;
}

.movie-card img,
.person-card img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 6px;
}

.movie-card:hover,
.person-card:hover {
    opacity: 0.85;
}

.movie-title,
.person-name {
    font-size: 14px;
    margin-top: 4px;
    text-align: center;
}


.movie-card,
.person-card {
    display: flex;
    flex-direction: column;
    width: 150px;
    text-decoration: none;
    color: white;
}

.movie-card img,
.person-card img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 6px;
}

.movie-card:hover,
.person-card:hover {
    opacity: 0.85;
}

.movie-title,
.person-name {
    font-size: 14px;
    margin-top: 4px;
    text-align: center;
}

.search-page-bar {
    margin: 20px 0 30px 0;
    position: relative;
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border-radius: 8px;
    border: none;
    font-size: 16px;
    background: #1f2937;
    color: white;
}

.search-btn {
    padding: 12px 20px;
    background: #00b4e4;
    border: none;
    border-radius: 8px;
    color: black;
    font-weight: bold;
    cursor: pointer;
}

.search-btn:hover {
    opacity: 0.85;
}

.autocomplete-results {
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    background: #111827;
    border-radius: 8px;
    padding: 10px;
    display: none;
    z-index: 20;
}

/* ============================
   AUTOCOMPLETE DROPDOWN (FINAL)
============================ */

.autocomplete-results {
    position: absolute;
    top: 52px; /* aligns perfectly under search bar */
    left: 0;
    width: 100%;
    background: #111;
    border-radius: 8px;
    overflow: hidden;
    z-index: 999;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    display: none; /* JS toggles this */
    max-height: 400px;
    overflow-y: auto;
}

.autocomplete-item {
    display: flex;
    gap: 12px;
    padding: 10px;
    text-decoration: none;
    color: #fff;
    transition: background .15s ease;
    align-items: center;
}

.autocomplete-item:hover {
    background: #222;
}

.autocomplete-thumb {
    width: 45px;
    height: 65px;
    object-fit: cover;
    border-radius: 4px;
    background: #333;
}

.autocomplete-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.autocomplete-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
}

.autocomplete-sub {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 2px;
}

.no-results {
    padding: 12px;
    text-align: center;
    color: #aaa;
    font-size: 0.9rem;
}

.search-page-bar {
    position: relative;
}

.search-page-bar {
    position: relative;
}

.search-page-bar {
    margin: 20px 0 30px 0;
    position: relative;
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border-radius: 8px;
    border: none;
    font-size: 16px;
    background: #1f2937;
    color: white;
}

.search-btn {
    padding: 12px 20px;
    background: #00b4e4;
    border: none;
    border-radius: 8px;
    color: black;
    font-weight: bold;
    cursor: pointer;
}

.search-btn:hover {
    opacity: 0.85;
}

.autocomplete-results {
    position: absolute;
    top: 52px;
    left: 0;
    width: 100%;
    background: #111;
    border-radius: 8px;
    overflow: hidden;
    z-index: 999;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    display: none;
    max-height: 400px;
    overflow-y: auto;
}

.autocomplete-item {
    display: flex;
    gap: 12px;
    padding: 10px;
    text-decoration: none;
    color: #fff;
    transition: background .15s ease;
    align-items: center;
}

.autocomplete-item:hover {
    background: #222;
}

.autocomplete-thumb {
    width: 45px;
    height: 65px;
    object-fit: cover;
    border-radius: 4px;
    background: #333;
}

.autocomplete-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.autocomplete-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
}

.autocomplete-sub {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 2px;
}

.no-results {
    padding: 12px;
    text-align: center;
    color: #aaa;
    font-size: 0.9rem;
}

.movie-card,
.person-card {
    display: flex;
    flex-direction: column;
    width: 150px;
    text-decoration: none;
    color: white;
}

.movie-card img,
.person-card img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 6px;
}

.movie-card:hover,
.person-card:hover {
    opacity: 0.85;
}

.movie-title,
.person-name {
    font-size: 14px;
    margin-top: 4px;
    text-align: center;
}

.search-page-bar {
    margin: 20px 0 30px 0;
    position: relative;
}

.search-form {
    display: flex;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border-radius: 8px;
    border: none;
    font-size: 16px;
    background: #1f2937;
    color: white;
}

.search-btn {
    padding: 12px 20px;
    background: #00b4e4;
    border: none;
    border-radius: 8px;
    color: black;
    font-weight: bold;
    cursor: pointer;
}

.search-btn:hover {
    opacity: 0.85;
}

.autocomplete-results {
    position: absolute;
    top: 52px;
    left: 0;
    width: 100%;
    background: #111;
    border-radius: 8px;
    overflow: hidden;
    z-index: 999;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    display: none;
    max-height: 400px;
    overflow-y: auto;
}

.autocomplete-item {
    display: flex;
    gap: 12px;
    padding: 10px;
    text-decoration: none;
    color: #fff;
    transition: background .15s ease;
    align-items: center;
}

.autocomplete-item:hover {
    background: #222;
}

.autocomplete-thumb {
    width: 45px;
    height: 65px;
    object-fit: cover;
    border-radius: 4px;
    background: #333;
}

.autocomplete-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.autocomplete-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
}

.autocomplete-sub {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 2px;
}

.no-results {
    padding: 12px;
    text-align: center;
    color: #aaa;
    font-size: 0.9rem;
}

.movie-card,
.person-card {
    display: flex;
    flex-direction: column;
    width: 150px;
    text-decoration: none;
    color: white;
}

.movie-card img,
.person-card img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 6px;
}

.movie-card:hover,
.person-card:hover {
    opacity: 0.85;
}

.movie-title,
.person-name {
    font-size: 14px;
    margin-top: 4px;
    text-align: center;
}


.cast-grid {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding-bottom: 10px;
}

.cast-item {
    flex: 0 0 120px;
    text-decoration: none;
    color: white;
}

.collection-hero-poster {
    width: 260px;
    border-radius: 12px;
}

.collection-hero {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.collection-poster {
    width: 250px;
    border-radius: 10px;
}

/* SEARCH PAGE LAYOUT */
.search-page {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

/* SEARCH BAR */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.search-bar input {
    flex: 1;
    padding: 12px 15px;
    font-size: 16px;
    border-radius: 6px;
    border: 1px solid #ccc;
}

.search-bar button {
    padding: 12px 20px;
    font-size: 16px;
    border-radius: 6px;
    border: none;
    background: #007bff;
    color: white;
    cursor: pointer;
}

.search-bar button:hover {
    background: #005fcc;
}

/* GRID FIX */
.rec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

/* ============================
   CLEAN TMDB-STYLE SEARCH PAGE
============================ */

.search-page {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
}

/* SEARCH BAR */
.search-bar {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 0 auto 40px auto;
}

.search-bar input {
    width: 100%;
    padding: 14px 20px;
    padding-right: 120px;
    font-size: 18px;
    border-radius: 30px;
    border: none;
    outline: none;
    color: #fff;
    background: #1f2937;
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

.search-bar input::placeholder {
    color: #9ca3af;
}

.search-bar button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    padding: 10px 18px;
    border-radius: 25px;
    border: none;
    background: #01b4e4;
    color: white;
    font-size: 15px;
    cursor: pointer;
}

.search-bar button:hover {
    background: #009ac2;
}

/* AUTOCOMPLETE */
.autocomplete-dropdown {
    position: absolute;
    top: 52px;
    left: 0;
    width: 100%;
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 8px;
    display: none;
    z-index: 9999;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.ac-section-title {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: bold;
    background: #0d1117;
    border-bottom: 1px solid #1f2937;
}

.ac-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: white;
    transition: background 0.15s ease;
}

.ac-item:hover,
.ac-item.active {
    background: #1f2937;
}

.ac-thumb {
    width: 40px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

/* RESULTS GRID */
.rec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 22px;
    margin-top: 20px;
}

.movie-card,
.person-card {
    text-decoration: none;
    color: white;
    transition: transform 0.15s ease;
}

.movie-card:hover,
.person-card:hover {
    transform: scale(1.04);
}

.movie-card img,
.person-card img {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}

.movie-title,
.person-name {
    margin-top: 8px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
}
