/* ==========================================================================
   CineTrack Design System & Stylesheet
   ========================================================================== */

/* Design Tokens & Variables */
:root {
  --bg-main: #0b0f19;
  --bg-gradient: linear-gradient(135deg, #090d16 0%, #0d1527 50%, #13223f 100%);
  --bg-panel: rgba(22, 30, 49, 0.65);
  --bg-card: rgba(30, 41, 59, 0.45);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(var(--accent-primary-rgb), 0.5);
  
  /* Accent Colors */
  --accent-primary: #8b5cf6; /* Neon Violet */
  --accent-primary-rgb: 139, 92, 246;
  --accent-primary-hover: #a78bfa;
  --accent-primary-gradient-end: #7c3aed;
  --accent-primary-hover-gradient-end: #8b5cf6;
  --accent-secondary: #06b6d4; /* Neon Cyan */
  --accent-secondary-rgb: 6, 182, 212;
  --accent-secondary-hover: #22d3ee;
  
  /* Status Colors */
  --color-to-see: #3b82f6; /* Blue */
  --color-seen: #10b981; /* Emerald */
  --color-watching: #f59e0b; /* Amber */
  
  /* User Rating Palette */
  --rate-excellent: #10b981; /* Emerald */
  --rate-verygood: #14b8a6; /* Teal */
  --rate-good: #3b82f6; /* Blue */
  --rate-bad: #f97316; /* Orange */
  --rate-poor: #ef4444; /* Red */
  
  /* Text Palette */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Box Shadow */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 15px rgba(var(--accent-primary-rgb), 0.25);
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  
  /* Fonts */
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  background-image: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

input, select, textarea, button {
  font-family: inherit;
  color: inherit;
  background: transparent;
  border: none;
}

a {
  color: var(--accent-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--accent-secondary-hover);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* App Container Layout */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* App Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-color);
  gap: 1.5rem;
}

.header-left .logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  font-size: 2rem;
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-left h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Global Search Box */
.header-center {
  flex: 1;
  max-width: 500px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 0.5rem 1rem;
  transition: all var(--transition-fast);
}

.search-box:focus-within {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-glow);
  background: rgba(22, 30, 49, 0.85);
}

.search-icon {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-right: 0.75rem;
}

.search-box input {
  width: 100%;
  padding: 0.25rem 0;
  font-size: 0.95rem;
  outline: none;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.clear-btn {
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.25rem;
  font-size: 1rem;
}
.clear-btn:hover {
  color: var(--text-primary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Button UI Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-gradient-end) 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(var(--accent-primary-rgb), 0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(var(--accent-primary-rgb), 0.5);
  background: linear-gradient(135deg, var(--accent-primary-hover) 0%, var(--accent-primary-hover-gradient-end) 100%);
}

.btn-secondary-icon {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 0.5rem;
  cursor: pointer;
  border-radius: var(--radius-md);
}
.btn-secondary-icon:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

.btn-outline {
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  background: transparent;
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
}

.btn-icon {
  padding: 0.65rem;
  border-radius: var(--radius-md);
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-icon:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
  background: rgba(255, 255, 255, 0.05);
}

.btn-danger-outline {
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  background: transparent;
}
.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.1);
}

.btn-full {
  width: 100%;
}

/* App Main Layout */
.app-main {
  flex: 1;
  padding: 2rem 0;
}

/* Stats Dashboard Section */
.stats-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  font-size: 1.25rem;
}

.stat-total {
  background: rgba(var(--accent-primary-rgb), 0.15);
  color: var(--accent-primary);
}
.stat-watched {
  background: rgba(16, 185, 129, 0.15);
  color: var(--color-seen);
}
.stat-watching {
  background: rgba(245, 158, 11, 0.15);
  color: var(--color-watching);
}
.stat-watchlist {
  background: rgba(59, 130, 246, 0.15);
  color: var(--color-to-see);
}
.stat-rating {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Filter Toolbar */
.filter-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  flex: 1;
}

.sort-group {
  display: flex;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 140px;
}

.filter-item label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.filter-item select {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.5rem 2rem 0.5rem 0.75rem;
  font-size: 0.875rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  transition: all var(--transition-fast);
}

.filter-item select:focus {
  border-color: var(--border-focus);
}

/* Active Tags Container */
.active-tags-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.85rem;
}

.tags-label {
  color: var(--text-muted);
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.6rem;
  background: rgba(var(--accent-primary-rgb), 0.15);
  border: 1px solid rgba(var(--accent-primary-rgb), 0.3);
  color: var(--accent-primary-hover);
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
}

.tag-pill i {
  cursor: pointer;
}
.tag-pill i:hover {
  color: #ffffff;
}

.reset-link {
  color: var(--accent-secondary);
  background: none;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
}
.reset-link:hover {
  text-decoration: underline;
}

/* Media Grid Section */
.media-grid-section {
  position: relative;
  min-height: 300px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
}

/* Media Card */
.media-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
  backdrop-filter: blur(12px);
  cursor: pointer;
  position: relative;
}

.media-card:hover {
  transform: translateY(-8px);
  border-color: rgba(var(--accent-primary-rgb), 0.25);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

/* Poster Container */
.card-poster-container {
  position: relative;
  width: 100%;
  padding-top: 145%; /* Film poster aspect ratio approx 1:1.45 */
  background: rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.card-poster {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.media-card:hover .card-poster {
  transform: scale(1.05);
}

/* Fallback Poster Gradient */
.fallback-poster {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1e1b4b 0%, #311042 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  gap: 0.75rem;
}

.fallback-poster i {
  font-size: 2.5rem;
  color: rgba(255, 255, 255, 0.15);
}

.fallback-poster span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

/* Ratings Overlay on Card */
.card-ratings-overlay {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  z-index: 2;
}

.rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #ffffff;
  backdrop-filter: blur(4px);
}

.rating-badge-imdb i {
  color: #fbbf24; /* Yellow */
}

.rating-badge-rt i {
  color: #ef4444; /* Tomato Red */
}

/* Watch Status Indicator on Card */
.card-status-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.2rem 0.6rem;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: var(--radius-pill);
  backdrop-filter: blur(4px);
  z-index: 2;
  box-shadow: var(--shadow-sm);
}

.card-status-seen {
  background: rgba(16, 185, 129, 0.85);
  color: #ffffff;
}

.card-status-to-see {
  background: rgba(59, 130, 246, 0.85);
  color: #ffffff;
}

.card-status-watching {
  background: rgba(245, 158, 11, 0.85);
  color: #ffffff;
}

/* Card Info */
.card-info {
  display: flex;
  flex-direction: column;
  padding: 0.5rem;
  flex: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.card-type {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-secondary);
}

.card-year {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-director {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-director strong {
  color: var(--text-muted);
  font-weight: normal;
}

/* User Rating Box (Card Bottom) */
.card-user-rating {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-rating-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.user-rating-value {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.rating-excellent { background: rgba(16, 185, 129, 0.15); color: var(--rate-excellent); border: 1px solid rgba(16, 185, 129, 0.3); }
.rating-very-good { background: rgba(20, 184, 166, 0.15); color: var(--rate-verygood); border: 1px solid rgba(20, 184, 166, 0.3); }
.rating-good { background: rgba(59, 130, 246, 0.15); color: var(--rate-good); border: 1px solid rgba(59, 130, 246, 0.3); }
.rating-bad { background: rgba(249, 115, 22, 0.15); color: var(--rate-bad); border: 1px solid rgba(249, 115, 22, 0.3); }
.rating-poor { background: rgba(239, 104, 104, 0.15); color: var(--rate-poor); border: 1px solid rgba(239, 104, 104, 0.3); }

/* Empty State Styling */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
  text-align: center;
  background: var(--bg-panel);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  margin-top: 1rem;
}

.empty-icon {
  font-size: 3.5rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.empty-state p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 400px;
  margin-bottom: 1.5rem;
}

/* Modals Overlay Base */
.modal {
  display: none; /* Controlled by JS */
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 7, 18, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.25s ease-out;
}

.modal.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Modal Content Box */
.modal-content {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
}

.modal-large {
  max-width: 800px;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.close-modal-btn {
  font-size: 1.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast);
}
.close-modal-btn:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Form Styles inside Modals */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  letter-spacing: 0.05em;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  font-size: 0.95rem;
  outline: none;
  transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--border-focus);
  background: rgba(0, 0, 0, 0.4);
}

.form-group textarea {
  resize: vertical;
}

.input-with-button {
  display: flex;
  gap: 0.5rem;
}

.input-with-button input {
  flex: 1;
}

.help-text {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Custom Forms Columns layout */
.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.col-12 { flex: 0 0 100%; }
.col-8 { flex: 0 0 calc(66.66% - 0.5rem); }
.col-6 { flex: 0 0 calc(50% - 0.5rem); }
.col-4 { flex: 0 0 calc(33.33% - 0.5rem); }
.col-3 { flex: 0 0 calc(25% - 0.5rem); }

/* Alerts inside modals */
.info-alert {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(var(--accent-secondary-rgb), 0.1);
  border: 1px solid rgba(var(--accent-secondary-rgb), 0.2);
  border-radius: var(--radius-sm);
  color: var(--accent-secondary-hover);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  align-items: center;
}

.warning-alert {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-sm);
  color: #fbbf24;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  align-items: center;
}

/* Modal Tabs */
.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.15);
}

.tab-btn {
  flex: 1;
  padding: 1rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  border-bottom: 2px solid transparent;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
  color: var(--accent-primary-hover);
  border-bottom-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.05);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Add Modal (Search Online Tab UI) */
.search-form-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.search-input-group {
  flex: 1;
}

.search-input-group input {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.search-input-group input:focus {
  border-color: var(--border-focus);
}

.type-select-group select,
.source-select-group select {
  height: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 2rem 0.75rem 1rem;
  font-size: 0.95rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.1rem;
}

/* Search results list */
.search-results-list {
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-right: 0.25rem;
}

.search-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
  text-align: center;
}

.search-placeholder i {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  transition: all var(--transition-fast);
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

.result-poster {
  width: 48px;
  height: 70px;
  object-fit: cover;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
}

.result-poster-fallback {
  width: 48px;
  height: 70px;
  background: #1e1b4b;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 1.25rem;
  color: var(--text-muted);
}

.result-info {
  flex: 1;
  min-width: 0;
}

.result-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.result-type-badge {
  text-transform: uppercase;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
}

.type-movie { color: var(--accent-secondary); }
.type-series { color: var(--accent-primary-hover); }

/* Detail View Modal Grid */
.detail-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  padding: 0.5rem;
}

.detail-poster-sec {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-poster {
  width: 100%;
  aspect-ratio: 1 / 1.45;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  background: rgba(0, 0, 0, 0.3);
}

.detail-ratings-row {
  display: flex;
  justify-content: space-around;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  text-align: center;
}

.detail-rating-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.rating-source-logo {
  font-size: 1rem;
  color: var(--text-muted);
}
.rating-source-logo.imdb { color: #f5c518; }
.rating-source-logo.rt { color: #f93c00; }

.detail-rating-item .score {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
}

.detail-rating-item .source-name {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Awards & Acclaim Cards styles */
.detail-awards-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(234, 179, 8, 0.08); /* Transparent gold */
  border: 1px dashed rgba(234, 179, 8, 0.35); /* Dashed gold border */
  margin-top: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
}

.detail-awards-card .awards-icon {
  font-size: 1.4rem;
  color: #facc15; /* Neon gold */
  animation: trophyPulse 2s infinite alternate;
}

.detail-awards-card .awards-content {
  font-size: 0.85rem;
  font-weight: 500;
  color: #fef08a; /* Light gold/yellow */
  line-height: 1.45;
}

@keyframes trophyPulse {
  0% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(234, 179, 8, 0.4)); }
  100% { transform: scale(1.1); filter: drop-shadow(0 0 8px rgba(234, 179, 8, 0.8)); }
}

.detail-acclaim-summary-card {
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.06); /* Transparent Indigo */
  border: 1px solid rgba(99, 102, 241, 0.25);
  margin-top: 0.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(8px);
}

.detail-acclaim-summary-card .summary-card-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #a5b4fc; /* Light Indigo */
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.detail-acclaim-summary-card .summary-card-text {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
  font-style: italic;
}

/* Laurel badges styling */
.detail-laurels-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: -0.25rem;
  margin-bottom: 0.75rem;
}

.laurel-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

.laurel-citra {
  background: rgba(220, 38, 38, 0.08); /* Transparent Red */
  border: 1px solid rgba(234, 179, 8, 0.4); /* Gold border */
  color: #fef08a; /* Light gold text */
}

.laurel-citra i {
  color: #facc15; /* Gold award icon */
}

.laurel-festival {
  background: rgba(13, 148, 136, 0.08); /* Transparent Teal */
  border: 1px solid rgba(13, 148, 136, 0.35); /* Teal border */
  color: #ccfbf1; /* Light Teal text */
}

.laurel-festival i {
  color: #2dd4bf; /* Teal earth/star icon */
}

.laurel-maya {
  background: rgba(168, 85, 247, 0.08); /* Transparent Purple */
  border: 1px solid rgba(168, 85, 247, 0.35); /* Purple border */
  color: #f3e8ff; /* Light Purple text */
}

.laurel-maya i {
  color: #c084fc; /* Purple star icon */
}

.laurel-academy {
  background: rgba(234, 179, 8, 0.08); /* Transparent Gold */
  border: 1px solid rgba(234, 179, 8, 0.35); /* Gold border */
  color: #fef08a; /* Gold text */
}

.laurel-academy i {
  color: #facc15; /* Gold trophy icon */
}

/* Detail Info Section (Right) */
.detail-info-sec {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.detail-title-row {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.detail-meta-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.badge-text {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.badge-movie { background: rgba(var(--accent-secondary-rgb), 0.15); color: var(--accent-secondary); }
.badge-series { background: rgba(var(--accent-primary-rgb), 0.15); color: var(--accent-primary-hover); }

.detail-year {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.detail-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
}

.detail-plot {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
  border-left: 2px solid var(--accent-primary);
  padding-left: 0.75rem;
}

/* Detail Metadatas (Cast/Language) */
.detail-crew-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.crew-item {
  font-size: 0.9rem;
}

.crew-item strong {
  color: var(--text-secondary);
  font-weight: 600;
  width: 90px;
  display: inline-block;
}

.crew-item span {
  color: var(--text-primary);
}

/* Watch Tracker Box inside Modal */
.detail-tracker-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: auto;
}

.tracker-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.status-toggle-container {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.status-toggle-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: rgba(0, 0, 0, 0.2);
}

.status-toggle-btn.active.to-see {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--color-to-see);
  color: var(--color-to-see);
}

.status-toggle-btn.active.seen {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--color-seen);
  color: var(--color-seen);
}

.status-toggle-btn.active.watching {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--color-watching);
  color: var(--color-watching);
}

/* User Rating Selection Dropdown */
.rating-select-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  animation: slideDownFade 0.2s ease-out;
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.rating-select-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.rating-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.rate-option-btn {
  flex: 1;
  min-width: 80px;
  padding: 0.4rem 0;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.2);
}

.rate-option-btn:hover {
  transform: translateY(-1px);
}

/* Selection Rating Options colors */
.rate-option-btn[data-rating="Excellent"].active { background: var(--rate-excellent); border-color: var(--rate-excellent); color: #000000; }
.rate-option-btn[data-rating="Very Good"].active { background: var(--rate-verygood); border-color: var(--rate-verygood); color: #000000; }
.rate-option-btn[data-rating="Good"].active { background: var(--rate-good); border-color: var(--rate-good); color: #ffffff; }
.rate-option-btn[data-rating="Bad"].active { background: var(--rate-bad); border-color: var(--rate-bad); color: #000000; }
.rate-option-btn[data-rating="Poor"].active { background: var(--rate-poor); border-color: var(--rate-poor); color: #ffffff; }

/* Detail Footer Action */
.detail-modal-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}

/* Custom Details Modal Layout & Scrolling */
.detail-modal-content {
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  padding: 0 !important;
}

#detail-modal-body {
  overflow-y: auto;
  flex: 1;
  padding: 2.25rem 2rem 2rem 2rem;
}

.detail-close-btn {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  z-index: 100;
  background: rgba(15, 23, 42, 0.75) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 50% !important;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: var(--text-secondary);
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  transition: all var(--transition-fast);
}

.detail-close-btn:hover {
  background: rgba(30, 41, 59, 0.95) !important;
  color: var(--text-primary) !important;
  transform: scale(1.05);
}

/* Toast Notification Styles */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 9999;
  backdrop-filter: blur(8px);
  transform: translateY(100px);
  opacity: 0;
  transition: all var(--transition-normal);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-success i { color: var(--color-seen); }
.toast-info i { color: var(--accent-secondary); }
.toast-error i { color: var(--rate-poor); }

/* Streaming Availability Indicators */
.card-streaming-platforms {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}

.stream-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 800;
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: default;
}

.stream-badge.netflix {
  background: #e50914;
}

.stream-badge.prime {
  background: #00a8e1;
}

.stream-badge.hotstar {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  color: #fbbf24 !important;
  border-color: rgba(251, 191, 36, 0.2);
}

.stream-badge.sonyliv {
  background: #2e2e2e;
  border-color: rgba(255, 255, 255, 0.2);
}

.detail-streaming-list {
  color: var(--text-primary);
  font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    padding: 1rem 0;
  }
  
  .header-left {
    display: flex;
    justify-content: center;
  }

  .header-center {
    max-width: 100%;
  }

  .header-right {
    justify-content: space-between;
  }
  
  .stats-dashboard {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .filter-toolbar {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
  }

  .filter-group {
    flex-direction: column;
  }

  .filter-item {
    min-width: 100%;
  }

  .sort-group {
    margin-top: 0.5rem;
  }

  .sort-group .filter-item {
    min-width: 100%;
  }
  
  .media-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
  }

  /* Shrink card labels/title on mobile grid */
  .card-info {
    padding: 0.75rem;
  }

  .card-title {
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
  }

  .card-director {
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
  }

  .card-user-rating {
    padding-top: 0.5rem;
  }

  .user-rating-label {
    display: none; /* Hide label to save space */
  }

  .user-rating-value {
    width: 100%;
    text-align: center;
  }

  /* Modals */
  .modal-content {
    max-height: 95vh;
  }

  #detail-modal-body {
    padding: 2.5rem 1.25rem 1.25rem 1.25rem;
  }

  .detail-close-btn {
    top: 0.75rem;
    right: 0.75rem;
  }

  .detail-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .detail-poster-sec {
    max-width: 200px;
    margin: 0 auto;
  }

  .detail-title {
    font-size: 1.5rem;
  }

  .form-row {
    flex-direction: column;
    gap: 0.5rem;
  }

  .col-12, .col-8, .col-6, .col-4, .col-3 {
    flex: 0 0 100%;
  }
}

@media (max-width: 480px) {
  .stats-dashboard {
    grid-template-columns: 1fr;
  }
}

/* Streaming Filter Chips styling */
.streaming-filter-chips::-webkit-scrollbar {
  display: none; /* Hide scrollbar for Chrome, Safari, Opera */
}
.streaming-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast) ease;
}
.streaming-chip:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(var(--accent-primary-rgb), 0.4);
  color: var(--text-primary);
}
.streaming-chip.active {
  background: rgba(var(--accent-primary-rgb), 0.15);
  border-color: var(--accent-primary);
  color: var(--text-primary);
  box-shadow: 0 0 8px rgba(var(--accent-primary-rgb), 0.25);
}

