/* Premium Dark Theme - Top Navigation Layout (Gimy Style) */

:root {
  --bg-color: #0b0f15;
  --header-bg: rgba(11, 15, 21, 0.85); /* Dark Glass Header */
  --panel-bg: #1a202c;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --accent: #00B51D;
  --accent-hover: #00e676;
  --border: #1e293b;
  --radius-lg: 12px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-top: 80px; /* Space for the fixed header */
}

/* --- The New Top Header --- */
.site-header {
  position: fixed; top: 0; left: 0; width: 100%; z-index: 1000;
  background: var(--header-bg);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: 70px; display: flex; align-items: center; justify-content: center;
}

.header-inner {
  width: 100%; max-width: 1400px; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}

.logo { font-size: 24px; font-weight: 900; color: var(--accent); text-decoration: none; margin-right: 20px; }

/* The 5 Main Menu Links */
.nav-links { display: flex; gap: 20px; align-items: center; }
.nav-item {
  color: var(--text-muted); text-decoration: none; font-size: 15px; font-weight: 600; transition: 0.2s;
}
.nav-item:hover, .nav-item.active { color: var(--accent); }

/* Search Bar (Compact) */
.header-search {
  display: flex; background: var(--panel-bg); border-radius: 20px; padding: 5px 15px;
  border: 1px solid var(--border); width: 250px; transition: all 0.2s;
}
.header-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(0, 181, 29, 0.2); }
.header-search input { background: transparent; border: none; color: #fff; outline: none; flex: 1; font-size: 13px; }
.header-search button { background: transparent; border: none; color: var(--text-muted); cursor: pointer; transition: 0.2s;}
.header-search button:hover { color: var(--accent); }

/* --- Main Layout Container --- */
.container {
  max-width: 1400px; margin: 0 auto; padding: 20px; min-height: 80vh;
}

/* --- Typography --- */
.h2 { font-size: 20px; font-weight: 700; margin-bottom: 16px; display:flex; align-items:center; gap: 10px; }
.muted { color: var(--text-muted); font-size: 14px; line-height: 1.6; }

/* --- Movie Grid & Hover Cards --- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; }
.card { display: flex; flex-direction: column; text-decoration: none; color: var(--text-main); transition: all 0.2s; border-radius: var(--radius-lg); }
.poster-wrapper { overflow: hidden; border-radius: var(--radius-lg); aspect-ratio: 2/3; background: var(--panel-bg); position: relative; box-shadow: 0 4px 6px rgba(0,0,0,0.3); }
.poster { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.card:hover .poster { transform: scale(1.08); }
.t { margin-top: 10px; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m { margin-top: 4px; font-size: 12px; color: var(--text-muted); }

/* --- Buttons & Pills --- */
.pill { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 20px; font-size: 12px; background: var(--panel-bg); border: 1px solid var(--border); color: var(--text-muted); }
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; background: var(--panel-bg); color: var(--text-main); border: 1px solid var(--border); border-radius: var(--radius-sm); text-decoration: none; font-size: 14px; font-weight: 500; transition: all 0.2s; cursor: pointer; margin-right: 8px;}
.btn:hover { background: var(--border); color: #fff; }

/* --- Topbar Dropdowns (Unified Style) --- */
.dropdown { position: relative; display: inline-block; }

.dropdown-btn {
  background: rgba(17, 24, 39, 0.8); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: #9ca3af; 
  padding: 0 16px; 
  height: 32px; /* ✅ Fixed height perfectly matches the search bar */
  border: 1px solid #374151; border-radius: 20px;
  font-size: 13px; cursor: pointer; display: inline-flex; justify-content: center; align-items: center; gap: 6px; font-weight: 600; transition: all 0.2s;
}
.dropdown-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Default Wide Menu (For Categories) */
.dropdown-menu {
  position: absolute; top: calc(100% + 10px); right: 0; background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid #374151; border-radius: 16px; min-width: 320px; padding: 15px;
  display: none; grid-template-columns: repeat(3, 1fr); gap: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.8); z-index: 100;
}

/* ✅ Small Menu (For Language) */
.dropdown-menu.menu-sm {
  min-width: 120px;
  grid-template-columns: 1fr; /* Single column */
  padding: 10px;
}

.dropdown-menu::before { content: ""; position: absolute; top: -15px; left: 0; width: 100%; height: 15px; background: transparent; }
/* Only use hover effect on computers with a mouse */
@media (hover: hover) {
  .dropdown:hover .dropdown-menu { display: grid; animation: fadeInDown 0.2s ease-out; }
}
/* Allow JavaScript to force-show the menu on mobile taps */
.dropdown-menu.show { display: grid !important; animation: fadeInDown 0.2s ease-out; }
.dropdown-item { color: #9ca3af; text-decoration: none; font-size: 13px; padding: 8px 10px; border-radius: 8px; text-align: center; transition: all 0.2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.dropdown-item:hover, .dropdown-item.active { background: rgba(0, 181, 29, 0.1); color: var(--accent); }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* --- Section Header & Quick Links --- */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding-bottom: 10px;
}

.section-header .h2 { 
  margin-bottom: 0; /* Remove default margin so it aligns perfectly */
}

.quick-links {
  display: flex;
  gap: 14px;
  align-items: center;
}

.quick-link {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s;
  font-weight: 500;
}

.quick-link:hover {
  color: var(--accent);
}

/* --- Category Filter Box --- */
.filter-box {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 15px 20px;
  margin-bottom: 25px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.filter-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-bottom: 1px dashed rgba(255,255,255,0.05);
  padding-bottom: 12px;
}

.filter-row:last-child { border-bottom: none; padding-bottom: 0; }

.filter-label {
  color: var(--text-muted);
  font-size: 14px;
  white-space: nowrap;
  padding: 4px 0;
  width: 60px;
  font-weight: 600;
}

.filter-items { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; }

.filter-item {
  color: var(--text-main);
  text-decoration: none;
  font-size: 13px;
  padding: 4px 12px;
  border-radius: 14px;
  transition: all 0.2s;
}

.filter-item:hover { color: var(--accent); background: rgba(0, 181, 29, 0.1); }

.filter-item.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 181, 29, 0.4);
}

@media (max-width: 768px) {
  .filter-box { padding: 12px; gap: 8px; }
  .filter-row { padding-bottom: 8px; }
  .filter-label { width: 50px; font-size: 13px; }
  .filter-item { padding: 4px 10px; font-size: 12px; }
}

/* Mobile fix: Hide or wrap links on small screens */
@media (max-width: 768px) {
  .section-header { flex-direction: column; align-items: flex-start; gap: 10px; border-bottom: none; }
  .quick-links { gap: 10px; flex-wrap: wrap; }
}

/* --- Task 6: Mobile Adaptations --- */
@media (max-width: 768px) {
  .nav-links { display: none; } /* Hide the 5 links on mobile for now */
  .header-search { display: none; } /* Hide search box on very small screens */
  .grid { grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 12px; }
  .poster-wrapper { border-radius: 8px; }
  .h2 { font-size: 18px; }
  .t { font-size: 13px; }
  .btn { width: 100%; margin-bottom: 8px; }
}

/* --- Mobile Search Button --- */
.mobile-search-btn {
  display: none; /* Hidden on desktop */
  align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(17, 24, 39, 0.8); border: 1px solid #374151;
  color: #9ca3af; text-decoration: none; font-size: 14px; transition: all 0.2s;
}
.mobile-search-btn:hover { color: var(--accent); border-color: var(--accent); }

@media (max-width: 768px) {
  .header-search { display: none !important; } /* Hide big search bar on phones */
  .mobile-search-btn { display: inline-flex; } /* Show small icon on phones */
}