/* Premium CSS variables & styling system */
:root {
  --font-family-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-family-display: 'Outfit', var(--font-family-sans);

  /* Curated Sleek Color Palette */
  --bg-dark: #07070a;
  --bg-card: rgba(18, 18, 26, 0.65);
  --bg-card-hover: rgba(26, 26, 38, 0.8);
  --border-light: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(99, 102, 241, 0.3);
  
  /* Text */
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-disabled: #4b5563;

  /* Accents */
  --accent-indigo: #6366f1;
  --accent-indigo-glow: rgba(99, 102, 241, 0.15);
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.15);
  --accent-amber: #f59e0b;
  --accent-amber-glow: rgba(245, 158, 11, 0.15);
  --accent-rose: #ef4444;
  --accent-rose-glow: rgba(239, 68, 68, 0.15);
  
  --shadow-premium: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

/* Decorative Glow Orbs */
.glow-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
}

.orb-1 {
  top: -10%;
  left: 20%;
  width: 45vw;
  height: 45vw;
  background: var(--accent-indigo);
  animation: floatOrb 12s infinite alternate ease-in-out;
}

.orb-2 {
  bottom: -10%;
  right: 15%;
  width: 50vw;
  height: 50vw;
  background: var(--accent-emerald);
  animation: floatOrb 16s infinite alternate-reverse ease-in-out;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(50px, -30px) scale(1.1); }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  border: 2px solid var(--bg-dark);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-indigo);
}

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

/* Glassmorphism Panel Base */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-premium);
  transition: var(--transition-smooth);
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.5rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Account action icon-button group */
.account-action-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  padding: 0.3rem;
}

.header-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.header-icon-btn i {
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.header-icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  transform: scale(1.1);
}

.header-icon-btn--danger {
  color: rgba(239, 68, 68, 0.6);
}

.header-icon-btn--danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-rose);
  transform: scale(1.1);
}

/* Tooltip */
.btn-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(15, 15, 25, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 100;
}

.btn-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(255, 255, 255, 0.12);
}

.header-icon-btn:hover .btn-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

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

.logo-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-emerald));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.logo-icon i {
  color: white;
  width: 24px;
  height: 24px;
}

.brand-text h1 {
  font-family: var(--font-family-display);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-text h1 span {
  background: linear-gradient(135deg, var(--accent-indigo), #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.api-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 0.75rem 1.3rem;
  border-radius: var(--radius-md);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.api-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}

.user-email {
  color: var(--text-muted);
  font-size: 0.875rem;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Auth */
.auth-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 2rem;
  align-items: center;
  padding: 2rem;
}

.auth-copy {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.auth-copy h2 {
  font-family: var(--font-family-display);
  font-size: 2rem;
  line-height: 1.15;
}

.auth-copy p {
  color: var(--text-muted);
  max-width: 560px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.auth-actions .primary-btn,
.auth-actions .secondary-btn {
  flex: 1;
  min-width: 150px;
}

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

.stat-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1rem;
}

.stat-card:not(:last-child) {
  border-right: 1px solid var(--border-light);
}

@media (max-width: 768px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }

  .header-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .auth-panel {
    grid-template-columns: 1fr;
    padding: 1.5rem;
  }

  .stat-card:not(:last-child) {
    border-right: none;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 1.5rem;
  }
}

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

.icon-purple {
  background: var(--accent-indigo-glow);
  color: var(--accent-indigo);
}

.icon-green {
  background: var(--accent-emerald-glow);
  color: var(--accent-emerald);
}

.icon-amber {
  background: var(--accent-amber-glow);
  color: var(--accent-amber);
}

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

.stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.progress-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-right: 0.5rem;
}

.progress-ring-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-bar {
  transition: stroke-dashoffset 0.6s ease-in-out;
}

/* Navigation Tabs */
.tab-navigation {
  display: flex;
  padding: 0.4rem;
  gap: 0.4rem;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-md);
  font-family: var(--font-family-display);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.tab-btn i {
  width: 18px;
  height: 18px;
}

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

.tab-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
}

.tab-btn.highlight.active {
  background: var(--accent-indigo);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.tab-btn.highlight:hover:not(.active) {
  color: var(--accent-indigo);
  background: var(--accent-indigo-glow);
}

/* Panels */
.tab-panel {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Controls Panel (Search/Filters) */
.controls-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.search-box {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem 0.75rem 2.8rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9375rem;
  outline: none;
  transition: var(--transition-smooth);
}

.search-box input:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px var(--accent-indigo-glow);
}

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

.filters select {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.75rem 2rem 0.75rem 1rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9375rem;
  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='%239ca3af' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' 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: var(--transition-smooth);
}

.filters select:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px var(--accent-indigo-glow);
}

.clear-filters-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent-rose-glow);
  color: var(--accent-rose);
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 0.75rem 1.2rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9375rem;
  transition: var(--transition-smooth);
}

.clear-filters-btn:hover {
  background: var(--accent-rose);
  color: white;
}

.account-dialog {
  width: min(90vw, 460px);
  border-radius: calc(var(--radius-lg) + 4px);
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(8, 10, 18, 0.96);
}

.account-dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
}

.account-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.account-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.account-dialog .form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.account-dialog .form-header h3 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.03em;
}

.dialog-copy {
  color: var(--text-muted);
  line-height: 1.75;
  margin-top: 0.5rem;
}

.account-form .input-wrapper {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.account-form .input-wrapper input {
  color: var(--text-main);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.icon-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem;
  margin-left: auto;
}

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

.danger-btn {
  background: var(--accent-rose);
  color: white;
  box-shadow: 0 4px 18px rgba(239, 68, 68, 0.28);
}

.danger-btn:hover {
  background: #dc2626;
}

.hidden {
  display: none !important;
}

/* Media Grid */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

/* Media Cards */
.media-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  overflow: hidden;
  height: 100%;
}

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

.media-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-hover);
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.15);
}

.card-poster {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.4);
}

.card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card-rating-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(7, 7, 10, 0.85);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--accent-amber);
  padding: 0.4rem 0.7rem;
  border-radius: 30px;
  font-size: 0.8125rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.card-rating-badge i {
  fill: var(--accent-amber);
  width: 14px;
  height: 14px;
}

.media-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.4rem 0.75rem;
  border-radius: 30px;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.badge-watched {
  background: rgba(16, 185, 129, 0.85);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: white;
}

.badge-unwatched {
  background: rgba(99, 102, 241, 0.85);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: white;
}

.card-details {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 0.5rem;
}

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

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

.card-type-tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-indigo);
  text-transform: uppercase;
  background: var(--accent-indigo-glow);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.card-title {
  font-family: var(--font-family-display);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-main);
  /* Truncate overflow */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.6rem;
}

.card-comment {
  font-size: 0.8125rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 0.25rem;
  height: 3.6rem;
  font-style: italic;
  border-left: 2px solid rgba(255,255,255,0.06);
  padding-left: 0.5rem;
}

.card-actions {
  display: flex;
  margin-top: auto;
  padding-top: 1rem;
  gap: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  justify-content: space-between;
  align-items: center;
}

.imdb-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  transition: var(--transition-smooth);
}

.imdb-pill:hover:not(.disabled-pill) {
  color: var(--accent-amber);
  background: var(--accent-amber-glow);
}

.disabled-pill {
  opacity: 0.5;
  cursor: not-allowed;
}

.card-ops {
  display: flex;
  gap: 0.25rem;
}

.op-btn {
  background: transparent;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.op-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.op-btn-edit:hover {
  color: var(--accent-indigo);
  background: var(--accent-indigo-glow);
}

.op-btn-delete:hover {
  color: var(--accent-rose);
  background: var(--accent-rose-glow);
}

.op-btn i {
  width: 16px;
  height: 16px;
}

.quick-watched-btn {
  background: transparent;
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: var(--transition-smooth);
}

.quick-watched-btn:hover {
  background: var(--accent-emerald);
  color: white;
}

/* Empty State / Loader */
.loader-container {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 0;
  gap: 1rem;
  color: var(--text-muted);
}

.loader {
  border: 3px solid rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  border-top: 3px solid var(--accent-indigo);
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 2rem;
  text-align: center;
  gap: 1rem;
}

.empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.empty-icon i {
  width: 32px;
  height: 32px;
}

.empty-state h3 {
  font-family: var(--font-family-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.empty-state p {
  color: var(--text-muted);
  max-width: 400px;
  font-size: 0.9375rem;
}

/* Form Styles */
.add-container {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 900px) {
  .add-container {
    grid-template-columns: 1fr;
  }
  .preview-wrapper {
    display: none;
  }
}

.form-wrapper {
  padding: 2.25rem;
}

.form-header {
  margin-bottom: 2rem;
}

.form-header h2 {
  font-family: var(--font-family-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.form-header p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

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

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

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}

.required {
  color: var(--accent-rose);
}

.input-wrapper {
  position: relative;
}

.input-wrapper i {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.input-wrapper input {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.7rem 1rem 0.7rem 2.5rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9375rem;
  outline: none;
  transition: var(--transition-smooth);
}

.input-wrapper input:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px var(--accent-indigo-glow);
}

.input-wrapper input:placeholder-shown {
  text-overflow: ellipsis;
}

.textarea-wrapper textarea {
  width: 100%;
  height: 120px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9375rem;
  outline: none;
  resize: vertical;
  transition: var(--transition-smooth);
}

.textarea-wrapper textarea:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px var(--accent-indigo-glow);
}

.field-help {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Validations Styles */
.form-group.has-error input,
.form-group.has-error textarea {
  border-color: var(--accent-rose) !important;
  box-shadow: 0 0 0 3px var(--accent-rose-glow) !important;
}

.error-msg {
  color: var(--accent-rose);
  font-size: 0.75rem;
  display: none;
}

.form-group.has-error .error-msg {
  display: block;
}

/* Custom Checkbox Toggle */
.toggle-group {
   position: relative;
   display: flex;
   justify-content: center;
}

.toggle-label {
   display: flex;
   align-items: center;
   gap: 0.75rem;
   cursor: pointer;
   position: relative;
}

.toggle-label input {
   position: absolute;
   opacity: 0;
   width: 38px;
   height: 20px;
   cursor: pointer;
   z-index: 2;
   top: 0;
   left: 0;
}

.toggle-slider {
   position: relative;
   display: inline-block;
   width: 38px;
   height: 20px;
   background-color: rgba(255, 255, 255, 0.1);
   border-radius: 20px;
   border: 1px solid var(--border-light);
   transition: var(--transition-smooth);
   pointer-events: none;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-muted);
  border-radius: 50%;
  transition: var(--transition-smooth);
}

.toggle-label input:checked + .toggle-slider {
  background-color: var(--accent-indigo);
  border-color: var(--accent-indigo);
}

.toggle-label input:checked + .toggle-slider:before {
  transform: translateX(18px);
  background-color: white;
}

.toggle-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  user-select: none;
}

.toggle-label input:checked ~ .toggle-text {
  color: var(--text-main);
}

/* Watched Controller Component */
.watched-control-card {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 0.5rem;
}

.watched-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toggle-desc h3 {
  font-size: 0.9375rem;
  font-weight: 600;
}

.toggle-desc p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Slide animation for watched details */
.watched-fields-slide {
   max-height: 0;
   overflow: hidden;
   transition: max-height 0.4s ease-out;
   opacity: 0;
   pointer-events: none;
}

.watched-fields-slide.active {
   max-height: 500px;
   opacity: 1;
   pointer-events: auto;
}

.form-separator {
  border: 0;
  height: 1px;
  background: var(--border-light);
  margin: 1rem 0 0 0;
}

.pt-4 {
  padding-top: 1rem;
}

/* iOS-style slider round */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}

.switch input {
   position: absolute;
   opacity: 0;
   width: 50px;
   height: 28px;
   cursor: pointer;
   z-index: 2;
   top: 0;
   left: 0;
}

.slider {
   position: absolute;
   cursor: pointer;
   top: 0;
   left: 0;
   right: 0;
   bottom: 0;
   background-color: rgba(255, 255, 255, 0.08);
   border: 1px solid var(--border-light);
   transition: .4s;
   pointer-events: none;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-muted);
  transition: .4s;
}

.switch input:checked + .slider {
  background-color: var(--accent-emerald);
  border-color: var(--accent-emerald);
}

.switch input:checked + .slider:before {
  transform: translateX(22px);
  background-color: white;
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Buttons */
.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.primary-btn, .secondary-btn, .danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-md);
  padding: 0.75rem 1.5rem;
  font-family: var(--font-family-display);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition-smooth);
}

.primary-btn {
  background: var(--accent-indigo);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.primary-btn:hover {
  background: #4f46e5;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.secondary-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  color: var(--text-main);
}

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

.danger-btn {
  background: var(--accent-rose);
  color: white;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.25);
}

.danger-btn:hover {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
}

/* Live Preview & Sticky */
.preview-sticky {
  position: sticky;
  top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 320px;
  margin: 0 auto;
}

.preview-badge {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--accent-indigo);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-left: 0.5rem;
}

/* Modals */
.glass-modal {
   position: fixed;
   top: 50%;
   left: 50%;
   transform: translate(-50%, -50%) scale(0.92);
   background: rgba(18, 18, 26, 0.95);
   border: 1px solid var(--border-light);
   border-radius: var(--radius-lg);
   padding: 0;
   max-width: 500px;
   width: 90%;
   color: var(--text-main);
   box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
   outline: none;
   opacity: 0;
   transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
   z-index: 1002;
   display: none;
}

.glass-modal[open] {
   transform: translate(-50%, -50%) scale(1);
   opacity: 1;
   display: block;
}

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

.glass-modal[open] .modal-content {
  animation: modalFadeIn 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 4, 6, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.modal-backdrop[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
  z-index: 1001;
}

.modal-content {
  padding: 2rem;
  position: relative;
  z-index: 1;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-header h2 {
  font-family: var(--font-family-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-header h2 i {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  margin-right: 0.5rem;
}

.close-modal-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.close-modal-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.close-modal-btn i {
  width: 18px;
  height: 18px;
}

.disabled-wrapper {
  opacity: 0.65;
  pointer-events: none;
}

/* Danger Modal Specific */
.modal-danger {
  border-color: rgba(239, 68, 68, 0.4);
}

.modal-danger .modal-backdrop {
  background: rgba(239, 68, 68, 0.15);
}

.delete-confirm-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  padding: 1rem 0;
}

.danger-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--accent-rose-glow);
  color: var(--accent-rose);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 0.6s ease-out;
}

@keyframes pulse {
  0% { transform: scale(0.95); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.danger-icon i {
  width: 28px;
  height: 28px;
}

.delete-confirm-body p {
  color: var(--text-main);
  margin: 0;
  font-size: 0.95rem;
}

.delete-confirm-body strong {
  color: var(--text-main);
}

.warning-text {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.5;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.form-actions.full-width {
  grid-column: 1 / -1;
}

/* Toast System */
.toast-container {
  position: fixed;
  top: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  z-index: 9999;
  max-width: 350px;
}

.toast {
  background: rgba(18, 18, 26, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-light);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-main);
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast.toast-success {
  border-left: 4px solid var(--accent-emerald);
}

.toast.toast-success i {
  color: var(--accent-emerald);
}

.toast.toast-error {
  border-left: 4px solid var(--accent-rose);
}

.toast.toast-error i {
  color: var(--accent-rose);
}

.toast.toast-info {
  border-left: 4px solid var(--accent-indigo);
}

.toast.toast-info i {
  color: var(--accent-indigo);
}

.toast-content {
  font-size: 0.875rem;
  font-weight: 500;
}

@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.toast-fade-out {
  animation: slideOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(120%); opacity: 0; }
}

/* Footer Styles */
.app-footer {
  margin-top: auto;
  padding-top: 3rem;
  padding-bottom: 1.5rem;
  width: 100%;
}

.footer-divider {
  height: 1px;
  background: var(--border-light);
  margin-bottom: 1.5rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.copyright {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition-smooth);
}

.footer-link:hover {
  color: var(--accent-indigo);
}

.footer-link i {
  width: 14px;
  height: 14px;
}

.separator {
  color: var(--text-disabled);
  font-size: 0.8125rem;
}

@media (max-width: 600px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}
