/*     CUSTOM PROPERTIES     */
:root {
  /* Colors */
  --bg-main: #06060c;
  --bg-card: #0d0d16;
  --bg-surface: #13141f;

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.4);

  --text-main: #ffffff;
  --text-muted: #8e8e9e;
  --text-dark: #4a4a5a;

  --glass-bg: rgba(25, 25, 35, 0.6);
  --glass-border: rgba(255, 255, 255, 0.08);

  /* Typography */
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-bold: 700;
  --fw-black: 900;

  /* Fluid Spacing & Sizing */
  --wrapper-px: clamp(1rem, 4vw, 3rem);
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 20px;
  --border-radius-pill: 999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  background: none;
  border: none;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/*     NAVBAR     */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(6, 6, 12, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  padding: 1rem var(--wrapper-px);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1440px;
  margin: 0 auto;
}

.logo {
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: var(--fw-black);
  letter-spacing: 2px;
}

.nav-links {
  display: none;
  gap: 2rem;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-link {
  font-size: 0.85rem;
  font-weight: var(--fw-bold);
  letter-spacing: 1px;
  color: var(--text-muted);
  text-transform: uppercase;
}

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

.nav-link.active {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
  padding-bottom: 4px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-pill);
  padding: 0.4rem 1rem;
  width: clamp(150px, 20vw, 250px);
}

.search-bar input {
  background: transparent;
  border: none;
  color: var(--text-main);
  outline: none;
  width: 100%;
  font-size: 0.9rem;
}

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

.search-btn {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-btn:hover {
  color: var(--text-main);
}

.icon-btn {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  color: var(--text-main);
}

/*     HERO SECTION     */
.hero {
  position: relative;
  min-height: clamp(400px, 60vh, 600px);
  display: flex;
  align-items: center;
  padding: 0 var(--wrapper-px);
  overflow: hidden;
  margin: clamp(1rem, 3vw, 2rem) var(--wrapper-px);
  border-radius: var(--border-radius-lg);
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
      rgba(6, 6, 12, 0.95) 0%,
      rgba(6, 6, 12, 0.6) 40%,
      rgba(6, 6, 12, 0) 100%),
    linear-gradient(0deg,
      rgba(6, 6, 12, 0.9) 0%,
      rgba(6, 6, 12, 0) 30%);
}

.hero-content {
  max-width: 600px;
  position: relative;
  z-index: 10;
  padding: 2rem;
}

.hero-label {
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: var(--fw-bold);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: var(--fw-black);
  line-height: 1.1;
  margin-bottom: 2rem;
  text-transform: uppercase;
  letter-spacing: -1px;
}

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

/*     BUTTONS     */
.btn {
  padding: 0.8rem 1.5rem;
  border-radius: var(--border-radius-pill);
  font-size: 0.85rem;
  font-weight: var(--fw-bold);
  letter-spacing: 1px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.btn-outline {
  border: 1px solid var(--glass-border);
  background: var(--bg-surface);
  color: var(--text-muted);
}

.btn-outline:hover {
  border-color: var(--text-muted);
  color: var(--text-main);
}

/*     MAIN CONTENT     */
.main-content {
  flex: 1;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  padding: 2rem var(--wrapper-px);
}

/*     CONTROLS BAR (Tabs & View)     */
.controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 0.6rem 1.2rem;
  border-radius: var(--border-radius-pill);
  font-size: 0.75rem;
  font-weight: var(--fw-bold);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--glass-border);
  background: var(--bg-surface);
}

.tab-btn:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

.tab-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.view-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.view-label {
  font-size: 0.7rem;
  font-weight: var(--fw-bold);
  letter-spacing: 1px;
  color: var(--text-dark);
  margin-right: 0.5rem;
}

.view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--border-radius-sm);
  background: var(--bg-surface);
  color: var(--text-muted);
}

.view-btn:hover {
  color: var(--text-main);
}

.view-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

/*     MOVIES GRID     */
.movies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 2rem 1.5rem;
  margin-bottom: 3rem;
}

.movie-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  cursor: pointer;
}

.card-image-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.card-image-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 50%);
  opacity: 0;
  transition: opacity var(--transition-normal);
  pointer-events: none;
}

.movie-card:hover .card-image-wrap::after {
  opacity: 1;
}

.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

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

/* Favorite Icon Button */
.fav-icon-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s;
  opacity: 0;
}

.movie-card:hover .fav-icon-btn {
  opacity: 1;
}

.fav-icon-btn:hover {
  transform: scale(1.1);
  background: rgba(0, 0, 0, 0.7);
}

.card-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.card-title {
  font-size: 0.95rem;
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  flex: 1;
}

.card-rating {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: var(--fw-bold);
}

.card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/*     LOAD MORE     */
.load-more {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

/*     FOOTER     */
.footer {
  margin-top: auto;
  padding: 3rem var(--wrapper-px);
  border-top: 1px solid var(--glass-border);
  background: rgba(6, 6, 12, 0.5);
}

.footer-content {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
  text-align: center;
}

@media (min-width: 768px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-logo {
  font-size: 1.2rem;
  font-weight: var(--fw-black);
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
}

.footer-copy {
  font-size: 0.7rem;
  color: var(--text-dark);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-links a {
  font-size: 0.75rem;
  font-weight: var(--fw-bold);
  color: var(--text-muted);
  letter-spacing: 1px;
}

.footer-links a:hover {
  color: var(--text-main);
}

/*     MODAL (Hidden by default)     */
.modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--wrapper-px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

/* Optional smaller content box for rating modal */
.rating-modal-content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  max-width: 400px;
  width: 100%;
  padding: 2rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  text-align: center;
}

.rating-title {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.rating-checkboxes {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.rating-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: bold;
}

.rating-label input {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  cursor: pointer;
}

.rating-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.close-btn {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 2rem;
  color: var(--text-muted);
  line-height: 1;
}

.close-btn:hover {
  color: var(--text-main);
}

.modal-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 1rem;
}

@media (min-width: 768px) {
  .modal-layout {
    flex-direction: row;
  }
}

.modal-poster {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}

.modal-poster img {
  width: 100%;
  border-radius: var(--border-radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-title {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: var(--fw-black);
  text-transform: uppercase;
  letter-spacing: -0.5px;
}

.modal-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.modal-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--primary);
  font-weight: var(--fw-bold);
}

.modal-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.genre-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: var(--border-radius-pill);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.modal-desc {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.modal-cast {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.modal-cast strong {
  color: var(--text-main);
}

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

.icon-btn-large {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: #2a2a35;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #3a3a45;
}