:root {
  --background: #f1edca;
  --foreground: #1c1c1e; /* Deep neutral, Apple-style text color */

  --card: #ffffff;
  --card-foreground: #1c1c1e;

  --primary: #fece00; /* Logo yellow */
  --primary-light: #fff0a6;
  --primary-foreground: #1c1c1e;

  --secondary: #f5f5f7; /* Light gray from macOS UI */
  --secondary-foreground: #1c1c1e;

  --muted: #e5e5ea;
  --muted-foreground: #6e6e73;

  --accent: #f9624d; /* Logo red for subtle action or icons */
  --accent-foreground: #ffffff;

  --destructive: #f9624d;
  --destructive-foreground: #ffffff;

  --border: #d1d1d6;
  --input: #d1d1d6;
  --ring: #fece00;

  --radius: 0.75rem;
  --radius-sm: 0.5rem;
  --radius-lg: 1rem;

  --sidebar-background: #ffffff;
  --sidebar-foreground: #1c1c1e;
  --sidebar-width: 260px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.07);

  --blur-background: rgba(255, 255, 255, 0.85);
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #1c1c1e;
    --foreground: #f1f1f1;

    --card: #2c2c2e;
    --card-foreground: #f1f1f1;

    --primary: #fece00;
    --primary-light: #ffe96a;
    --primary-foreground: #1c1c1e;

    --secondary: #3a3a3c;
    --secondary-foreground: #f1f1f1;

    --muted: #48484a;
    --muted-foreground: #a1a1a3;

    --accent: #f9624d;
    --accent-foreground: #ffffff;

    --destructive: #f9624d;
    --destructive-foreground: #ffffff;

    --border: #3a3a3c;
    --input: #3a3a3c;
    --ring: #fece00;

    --sidebar-background: #2c2c2e;
    --sidebar-foreground: #f1f1f1;

    --blur-background: rgba(28, 28, 30, 0.85);
  }
}


* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

html, body {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button, input {
  font-family: inherit;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes slideRight {
  from { transform: translateX(-20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* App Container */
.app-container {
  display: flex;
  min-height: 100%;
  width: 100%;
  position: relative;
  overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background-color: var(--sidebar-background);
  color: var(--sidebar-foreground);
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  border-right: 1px solid var(--border);
  transition: transform var(--transition-normal);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 1.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.logo-container {
  display: flex;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.logo-image {
  height: 50px;
  position: relative;
}

.close-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted-foreground);
  transition: color var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-icon:hover {
  color: var(--foreground);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
}

.sidebar-nav ul {
  list-style: none;
  padding: 0;
}

.sidebar-nav li {
  padding: 0.85rem 1.5rem;
  margin: 0.2rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.sidebar-nav li:hover {
  background-color: var(--accent);
  color: var(--accent-foreground);
}

.sidebar-nav li.active {
  background-color: var(--primary);
  color: var(--primary-foreground);
  box-shadow: var(--shadow-sm);
}

.icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Main Content Area */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  overflow-y: auto;
  transition: margin-left var(--transition-normal);
}

.content-container {
  padding: 2.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.space-y-6 > * + * {
  margin-top: 1.5rem;
}

.space-y-10 > * + * {
  margin-top: 2.5rem;
}

/* Toast Notification */
.toast {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  max-width: 350px;
  transform: translateY(-150%);
  transition: transform var(--transition-normal);
}

.toast.show {
  transform: translateY(0);
}

.toast-content {
  background-color: var(--card);
  color: var(--card-foreground);
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-weight: 500;
  display: flex;
  align-items: center;
  border-left: 4px solid var(--primary);
}

/* Search Bar */
.search-container {
  max-width: 700px;
  margin: 0 auto 2.5rem;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.95rem 1.25rem 0.95rem 3.2rem;
  border: 1px solid var(--input);
  border-radius: 9999px;
  background-color: var(--card);
  color: var(--card-foreground);
  font-size: 1rem;
  outline: none;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.search-input:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 2px rgba(var(--ring), 0.2), var(--shadow-sm);
}

.search-icon {
  position: absolute;
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  display: flex;
}

.search-button {
  position: absolute;
  right: 0.4rem;
  top: 50%;
  transform: translateY(-50%);
  background-color: var(--primary);
  color: var(--primary-foreground);
  border: none;
  border-radius: 9999px;
  padding: 0.7rem 1.6rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.search-button:hover {
  background-color: var(--primary-light);
  box-shadow: var(--shadow-md);
}

/* Section Headers */
.section-title {
  font-size: 1.85rem;
  font-weight: 700;
  margin-bottom: 1.75rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--border);
  margin-left: 0.75rem;
}

/* Movie Grid */
.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 3.5rem;
  animation: fadeIn var(--transition-normal);
}

/* Movie Card */
.movie-card {
  background-color: var(--card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
  isolation: isolate;
}

.movie-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.movie-poster-container {
  position: relative;
  overflow: hidden;
  aspect-ratio: 2/3;
}

.movie-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.movie-card:hover .movie-poster {
  transform: scale(1.05);
}

.movie-info {
  padding: 1.2rem;
  background-color: var(--card);
  position: relative;
  z-index: 1;
}

.movie-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.movie-year {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.movie-meta {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  gap: 0.75rem;
}

.watched-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background-color: var(--primary);
  color: var(--primary-foreground);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  border-radius: 9999px;
  box-shadow: var(--shadow-sm);
  letter-spacing: 0.02em;
  z-index: 10;
}

/* Actor Grid */
.actor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 2rem;
  margin-bottom: 3.5rem;
  animation: fadeIn var(--transition-normal);
}

/* Actor Card */
.actor-card {
  background-color: var(--card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
}

.actor-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.actor-photo-container {
  position: relative;
  overflow: hidden;
  aspect-ratio: 2/3;
}

.actor-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.actor-card:hover .actor-photo {
  transform: scale(1.05);
}

.actor-info {
  padding: 1.2rem;
  background-color: var(--card);
}

.actor-name {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.actor-role {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* Movie Detail */
.movie-detail {
  animation: slideUp var(--transition-normal);
}

.movie-backdrop {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  box-shadow: var(--shadow-lg);
}

.movie-detail-header {
  margin-bottom: 2rem;
}

.movie-detail-title {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.movie-meta {
  font-size: 1rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}

.movie-overview {
  font-size: 1.1rem;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.movie-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.btn {
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
  border: none;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background-color: var(--primary-light);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background-color: var(--muted);
}

/* Detail Tabs */
.detail-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.detail-tab {
  padding: 1rem 1.5rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-weight: 600;
  transition: all var(--transition-fast);
  position: relative;
}

.detail-tab.active {
  color: var(--primary);
}

.detail-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary);
}

.detail-tab-content {
  display: none;
  animation: fadeIn var(--transition-normal);
}

.detail-tab-content.active {
  display: block;
}

/* Credits Section */
.credits-section {
  margin-top: 2.5rem;
}

.credits-section h3 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border);
}

.credits-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}

.credit-item {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem;
  background-color: var(--card);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.credit-item:hover {
  background-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.credit-photo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.credit-info {
  flex: 1;
}

.credit-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.credit-role {
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

/* Actor Detail */
.actor-detail {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  animation: slideUp var(--transition-normal);
}

.actor-detail-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.5rem;
}

.actor-profile {
  width: 100%;
  max-width: 300px;
  border-radius: var(--radius-lg);
  margin: 0 auto;
  box-shadow: var(--shadow-lg);
  animation: fadeIn var(--transition-slow);
}

.actor-detail-name {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.actor-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  color: var(--muted-foreground);
}

.actor-bio {
  font-size: 1.1rem;
  line-height: 1.7;
}

/* Filmography */
.filmography {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.filmography-item {
  display: flex;
  flex-direction: column;
  background-color: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.filmography-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.film-poster {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
}

.film-info {
  padding: 1rem;
}

.film-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

.film-character, .film-year {
  font-size: 0.85rem;
  color: var(--muted-foreground);
  line-height: 1.5;
}

/* Detail List */
.detail-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.75rem 1.5rem;
  margin-bottom: 2rem;
}

.detail-list dt {
  font-weight: 600;
  color: var(--foreground);
}

.detail-list dd {
  color: var(--muted-foreground);
}

/* Company Logos */
.company-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.company-item {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: white;
  padding: 0.75rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.company-logo {
  max-width: 120px;
  max-height: 60px;
  object-fit: contain;
}

.company-name {
  font-weight: 500;
  padding: 0.5rem 1rem;
  color: #333;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background-color: var(--card);
  border-radius: var(--radius-lg);
  max-width: 800px;
  width: 100%;
  height: 80%;
  overflow-y: auto;
  position: relative;
  margin: 1.5rem;
  box-shadow: var(--shadow-xl);
  animation: slideUp var(--transition-normal);
  border: 1px solid var(--border);
}

.close-modal {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--foreground);
  z-index: 10;
  display: flex;
  padding: 0.5rem;
  border-radius: 9999px;
  background-color: var(--card);
  box-shadow: var(--shadow-sm);
  transition: background-color var(--transition-fast);
}

.close-modal:hover {
  background-color: var(--accent);
}

/* Loading State */
.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 300px;
  color: var(--muted-foreground);
  flex-direction: column;
  gap: 1rem;
}

.loading::before {
  content: "";
  width: 40px;
  height: 40px;
  border: 3px solid var(--muted);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--muted-foreground);
  background-color: var(--card);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border);
  margin: 2rem 0;
}

.empty-state p {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.empty-state p:first-child {
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--foreground);
}

/* Mobile Styles */
.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .mobile-only {
    display: block;
  }
  
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  
  .sidebar.active {
    transform: translateX(0);
    box-shadow: var(--shadow-xl);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .mobile-header {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background-color: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
  }
  
  .mobile-header h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
  }
  
  #open-sidebar {
    background: none;
    border: none;
    color: var(--foreground);
    cursor: pointer;
    display: flex;
  }
  
  .content-container {
    padding: 1.5rem;
  }
  
  .movie-grid, .actor-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.25rem;
  }
  
  .movie-detail-title {
    font-size: 1.75rem;
  }
  
  .detail-tabs {
    flex-wrap: wrap;
  }
  
  .credits-list {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  
  .modal-content {
    padding: 1.5rem;
    margin: 1rem;
  }
}

/* Additional Animations */
.fade-in {
  animation: fadeIn var(--transition-normal);
}

.slide-up {
  animation: slideUp var(--transition-normal);
}

.slide-right {
  animation: slideRight var(--transition-normal);
}

/* Image Loading Animation */
.movie-poster, .actor-photo, .film-poster, .movie-backdrop, .actor-profile {
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.movie-poster.loaded, .actor-photo.loaded, .film-poster.loaded, .movie-backdrop.loaded, .actor-profile.loaded {
  opacity: 1;
}



.movie-detail {
  width: 100%;
  height: 79.6vh;
  position: relative;
  border-radius: 16px;
  overflow: hidden; /* Ensures background and content respect the rounded corners */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed; /* Prevents background from scrolling */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: white;
}

/* Dimmed overlay over the background */
.movie-detail::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.8); /* Adjust for more/less dimming */
  z-index: 1;
}

/* Content container in front of the dimmed background */
.movie-detail-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
}
