/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

@import url("https://unpkg.com/trix@2.1.5/dist/trix.css");

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-secondary: #f1f3f4;
  --bg-card: #ffffff;
  --fg: #1a1a1a;
  --fg-secondary: #5a5a5a;
  --muted: #757575;
  --accent: #e50914;
  --accent-hover: #b8070f;
  --link: #0066cc;
  --border: #e0e0e0;
  --shadow: rgba(0, 0, 0, 0.1);
  --shadow-hover: rgba(0, 0, 0, 0.15);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f0f0f;
  --bg-secondary: #1a1a1a;
  --bg-card: #262626;
  --fg: #ffffff;
  --fg-secondary: #d1d5db;
  --muted: #9ca3af;
  --accent: #e50914;
  --accent-hover: #f40612;
  --link: #60a5fa;
  --border: #404040;
  --shadow: rgba(0, 0, 0, 0.4);
  --shadow-hover: rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  font-size: 16px;
}

/* Header Styles */
header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 4px var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

header>nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

nav[aria-label="Primary"] {
  display: flex;
  align-items: center;
  gap: 2rem;
}

nav[aria-label="Primary"] a:first-child {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}

nav[aria-label="Primary"] a:first-child:hover {
  color: var(--accent-hover);
}

nav[aria-label="Primary"] a:not(:first-child) {
  color: var(--fg);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

nav[aria-label="Primary"] a:not(:first-child):hover {
  color: var(--accent);
}

/* Header Controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

/* Language Dropdown */
.language-dropdown {
  position: relative;
}

.language-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  min-width: 70px;
}

.language-toggle:hover {
  background: var(--border);
  border-color: var(--accent);
}

.language-toggle[aria-expanded="true"] {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.language-toggle[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-arrow {
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.language-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 16px var(--shadow-hover);
  min-width: 160px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
}

.language-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.language-menu a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--fg);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border-radius: 0;
  white-space: nowrap;
}

.language-menu a:first-child {
  border-radius: 8px 8px 0 0;
}

.language-menu a:last-child {
  border-radius: 0 0 8px 8px;
}

.language-menu a:hover {
  background: var(--bg-secondary);
  color: var(--accent);
}

.language-menu a.active {
  background: var(--accent);
  color: white;
}

.language-menu a.active:hover {
  background: var(--accent-hover);
}

.flag {
  font-size: 1rem;
}

/* Theme Toggle */
.theme-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.2s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.theme-toggle:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.1);
}

.theme-icon {
  position: absolute;
  transition: all 0.3s ease;
}

[data-theme="light"] .light-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

[data-theme="light"] .dark-icon {
  opacity: 0;
  transform: rotate(180deg) scale(0.5);
}

[data-theme="dark"] .light-icon {
  opacity: 0;
  transform: rotate(-180deg) scale(0.5);
}

[data-theme="dark"] .dark-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Main Content */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  min-height: calc(100vh - 200px);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 1rem 0;
  font-weight: 600;
  line-height: 1.3;
  color: var(--fg);
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: 2rem;
  margin-bottom: 1.25rem;
}

h3 {
  font-size: 1.5rem;
}

p {
  margin: 0 0 1rem 0;
  color: var(--fg-secondary);
}

/* Links */
a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent);
}

/* Sections */
section {
  margin-bottom: 3rem;
}

section h2 {
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

/* Lists */
ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

li {
  margin-bottom: 0.75rem;
}

section ul li {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 4px var(--shadow);
  transition: all 0.2s ease;
}

section ul li:hover {
  box-shadow: 0 4px 8px var(--shadow-hover);
  transform: translateY(-1px);
}

section ul li a {
  font-weight: 500;
  font-size: 1.1rem;
  display: block;
}

/* Articles */
article {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 8px var(--shadow);
  margin-bottom: 2rem;
}

article header {
  position: static;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin-bottom: 1.5rem;
}

article h1 {
  color: var(--fg);
  margin-bottom: 0.5rem;
}

article p[itemprop="abstract"],
article p[itemprop="description"] {
  font-size: 1.1rem;
  color: var(--fg-secondary);
  font-style: italic;
  margin-bottom: 1.5rem;
}

/* Code Blocks */
pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

code {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  font-size: 0.9rem;
  color: var(--fg);
}

/* Tables (Admin) */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px var(--shadow);
}

th,
td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--fg);
}

tr:hover {
  background: var(--bg-secondary);
}

/* Forms */
form {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 4px var(--shadow);
}

form div {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--fg);
}

input,
textarea,
select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(229, 9, 20, 0.1);
}

input[type="submit"] {
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
  width: auto;
}

input[type="submit"]:hover {
  background: var(--accent-hover);
}

input[type="checkbox"] {
  width: auto;
  margin-right: 0.5rem;
}

fieldset {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  margin: 1rem 0;
}

legend {
  padding: 0 0.5rem;
  font-weight: 600;
  color: var(--fg);
}

/* Footer */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--fg-secondary);
  margin-top: 3rem;
}

/* Utility Classes */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 3rem 0 4rem 0;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: white !important;
  margin: -2rem -2rem 3rem -2rem;
  border-radius: 0 0 16px 16px;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  color: white !important;
}

.hero-subtitle {
  font-size: 1.25rem;
  opacity: 0.95;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.5;
  color: white !important;
}

/* Home Grid Layout */
.home-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

.home-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 8px var(--shadow);
}

.home-section h2 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
  color: var(--fg);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.5rem;
}

/* Code Cards */
.code-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.code-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.code-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px var(--shadow-hover);
  border-color: var(--accent);
}

.code-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.code-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--fg);
}

.code-card p {
  color: var(--fg-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.code-value {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

/* Enhanced Code Cards for Category Pages */
.code-detail {
  padding: 2rem;
}

.code-detail .code-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  gap: 1rem;
}

.code-detail .code-header h3 {
  margin: 0;
  flex: 1;
}

.code-detail .code-header .code-value {
  flex-shrink: 0;
  font-size: 1rem;
  padding: 0.5rem 1rem;
}

.code-excerpt {
  font-size: 1.1rem;
  color: var(--fg-secondary);
  font-style: italic;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.code-body {
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.code-body p {
  margin-bottom: 1rem;
}

.code-usage {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1.5rem;
}

.code-usage p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--fg-secondary);
}

.code-usage code {
  background: var(--bg);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--accent);
  border: 1px solid var(--border);
}

/* Category Cards */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.category-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  transition: all 0.2s ease;
}

.category-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px var(--shadow-hover);
  border-color: var(--accent);
}

.category-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.category-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--fg);
}

.category-card p {
  color: var(--fg-secondary);
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Blog Cards */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.blog-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.2s ease;
}

.blog-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px var(--shadow-hover);
  border-color: var(--accent);
}

.blog-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.blog-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--fg);
}

.blog-card p {
  color: var(--fg-secondary);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

.blog-card time {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Section Footer */
.section-footer {
  text-align: center;
  margin-top: 1rem;
}

.view-all-link {
  background: var(--accent);
  color: white !important;
  font-weight: 600;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: inline-block;
  border: 2px solid var(--accent);
}

.view-all-link:hover {
  background: var(--accent-hover);
  color: white !important;
  transform: translateY(-1px);
  border-color: var(--accent-hover);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Empty State */
.empty-state {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  padding: 2rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px dashed var(--border);
}

/* Enhanced List Styles for other pages */
section ul li {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px var(--shadow);
  transition: all 0.2s ease;
  position: relative;
}

section ul li:hover {
  box-shadow: 0 8px 16px var(--shadow-hover);
  transform: translateY(-2px);
  border-color: var(--accent);
}

section ul li a {
  font-weight: 600;
  font-size: 1.1rem;
  display: block;
  color: var(--fg);
}

section ul li a:hover {
  color: var(--accent);
}

/* Page Headers */
main>header h1 {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 2rem;
}

main>header p {
  font-size: 1.1rem;
  color: var(--fg-secondary);
  margin-bottom: 2rem;
}

/* Admin Dashboard */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 8px var(--shadow);
  transition: all 0.2s ease;
}

.admin-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px var(--shadow-hover);
  border-color: var(--accent);
}

.admin-card a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.admin-card h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--fg);
}

.admin-card p {
  color: var(--fg-secondary);
  line-height: 1.5;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .home-grid {
    gap: 2rem;
  }

  .code-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  header>nav {
    padding: 1rem;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  nav[aria-label="Primary"] {
    gap: 1rem;
  }

  .header-controls {
    align-self: flex-end;
    gap: 0.75rem;
    margin-left: 0;
  }

  .language-toggle {
    min-width: 60px;
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
  }

  .language-menu {
    right: 0;
    min-width: 140px;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  main {
    padding: 1rem;
  }

  .hero {
    margin: -1rem -1rem 2rem -1rem;
    padding: 2rem 1rem 3rem 1rem;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

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

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

  .home-section {
    padding: 1.5rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  article {
    padding: 1.5rem;
  }

  pre {
    padding: 1rem;
    font-size: 0.875rem;
  }

  table {
    font-size: 0.875rem;
  }

  th,
  td {
    padding: 0.75rem 0.5rem;
  }
}

/* Categories with Codes Layout */
.categories-with-codes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

.category-with-codes-section {
  background: var(--bg-card);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 2px 8px var(--shadow);
  border: 1px solid var(--border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: fit-content;
}

.category-with-codes-section:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--shadow-hover);
}

.category-title {
  margin: 0 0 1.25rem 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
}

.category-link {
  color: var(--fg);
  text-decoration: none;
  transition: color 0.2s ease;
  display: block;
}

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

.sample-codes-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.code-item {
  background: var(--bg-secondary);
  border-radius: 0.5rem;
  overflow: hidden;
  transition: all 0.2s ease;
  border: 1px solid var(--border);
}

.code-item:hover {
  transform: translateX(4px);
  box-shadow: 0 2px 8px var(--shadow-hover);
  border-color: var(--accent);
}

.netflix-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.2s ease;
  min-height: 56px;
}

.netflix-link:hover {
  background: var(--bg);
}

.code-number {
  background: var(--accent);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-weight: 600;
  font-size: 0.75rem;
  min-width: fit-content;
  flex-shrink: 0;
}

.code-title {
  color: var(--fg);
  font-weight: 500;
  line-height: 1.3;
  flex: 1;
  font-size: 0.875rem;
}

.view-complete-link {
  margin: 0;
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.view-complete-link .view-all-link {
  background: var(--accent);
  color: white !important;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  display: inline-block;
  transition: all 0.2s ease;
  border: 2px solid var(--accent);
}

.view-complete-link .view-all-link:hover {
  background: var(--accent-hover);
  color: white !important;
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Tablet responsive - 2 columns */
@media (max-width: 1024px) and (min-width: 769px) {
  .categories-with-codes {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

/* Mobile responsive - 1 column */
@media (max-width: 768px) {
  .categories-with-codes {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .category-with-codes-section {
    padding: 1.25rem;
  }

  .category-title {
    font-size: 1.1rem;
    margin-bottom: 1rem;
  }

  .sample-codes-grid {
    gap: 0.5rem;
    margin-bottom: 1rem;
  }

  .netflix-link {
    padding: 0.625rem;
    min-height: 48px;
  }

  .code-title {
    font-size: 0.8rem;
  }

  .code-number {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
  }

  .view-complete-link {
    padding-top: 0.75rem;
  }

  .view-complete-link .view-all-link {
    font-size: 0.85rem;
  }
}

/* Admin Form Styles */
.admin-form {
  max-width: 800px;
}

.form-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.form-section:last-child {
  border-bottom: none;
}

.form-section h3,
.form-section h4 {
  margin: 0 0 1.5rem 0;
  color: var(--fg);
  font-weight: 600;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--fg);
}

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  background: var(--bg-card);
  color: var(--fg);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.1);
}

.form-control[type="file"] {
  padding: 0.5rem 0.75rem;
}

.form-checkbox {
  margin-right: 0.5rem;
}

.checkbox-label {
  display: inline;
  margin: 0;
  cursor: pointer;
}

.form-help {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--fg-secondary);
}

.form-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  border: 1px solid;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: white;
}

.btn-secondary {
  background: var(--bg-secondary);
  border-color: var(--border);
  color: var(--fg);
}

.btn-secondary:hover {
  background: var(--bg);
  color: var(--fg);
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--fg);
}

.btn-outline:hover {
  background: var(--bg-secondary);
  color: var(--fg);
}

.error-messages {
  background: #fee;
  border: 1px solid #fcc;
  border-radius: 0.375rem;
  padding: 1rem;
  margin-bottom: 2rem;
}

.error-messages h4 {
  margin: 0 0 0.5rem 0;
  color: #c33;
}

.error-messages ul {
  margin: 0;
  padding-left: 1.5rem;
}

.error-messages li {
  color: #c33;
}

.empty-state {
  text-align: center;
  padding: 3rem;
  background: var(--bg-secondary);
  border-radius: 0.5rem;
}

.empty-state h3 {
  margin: 0 0 0.5rem 0;
  color: var(--fg);
}

.empty-state p {
  margin: 0 0 1.5rem 0;
  color: var(--fg-secondary);
}

/* Homepage Sections Styles */
.homepage-section {
  position: relative;
  margin-bottom: 3rem;
  border-radius: 0.75rem;
  overflow: hidden;
}

.homepage-section.section-hero {
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, var(--accent), #b91c1c);
  color: white;
}

.homepage-section.section-intro {
  background: var(--bg-secondary);
  padding: 3rem 2rem;
  text-align: center;
}

.homepage-section.section-features {
  background: var(--bg-card);
  padding: 3rem 2rem;
  border: 1px solid var(--border);
}

.homepage-section.section-how_it_works {
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  padding: 3rem 2rem;
  color: var(--fg);
}

.homepage-section.section-cta {
  background: linear-gradient(135deg, #1f2937, #374151);
  padding: 3rem 2rem;
  text-align: center;
  color: white;
}

.homepage-section.section-custom {
  padding: 3rem 2rem;
  background: var(--bg-card);
}

.section-image {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

.section-bg-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.section-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.homepage-section.section-hero .section-title {
  font-size: 3.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  color: white !important;
}

.section-text {
  font-size: 1.125rem;
  line-height: 1.7;
}

.section-text p {
  margin-bottom: 1.5rem;
}

.section-text p:last-child {
  margin-bottom: 0;
}

.homepage-section.section-hero .section-text {
  font-size: 1.25rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  color: white !important;
}

/* Color contrast fixes for homepage sections */
.homepage-section.section-hero .section-content {
  color: white !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.homepage-section.section-hero .section-title {
  color: white !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.homepage-section.section-hero .section-text {
  color: white !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.homepage-section.section-hero .section-text p {
  color: white !important;
}

/* Additional hero text color overrides */
.homepage-section.section-hero,
.homepage-section.section-hero * {
  color: white !important;
}

.hero,
.hero * {
  color: white !important;
}

/* Ensure text shadows for readability on red background */
.homepage-section.section-hero h1,
.homepage-section.section-hero h2,
.homepage-section.section-hero h3,
.homepage-section.section-hero p,
.hero h1,
.hero h2,
.hero h3,
.hero p {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5) !important;
}

.homepage-section.section-cta .section-content {
  color: white;
}

.homepage-section.section-how_it_works .section-content {
  color: #1f2937;
}

/* Dark theme adjustments for homepage sections */
:root[data-theme="dark"] .homepage-section.section-how_it_works {
  background: linear-gradient(135deg, #374151, #4b5563);
  color: white;
}

:root[data-theme="dark"] .homepage-section.section-how_it_works .section-content {
  color: white;
}

:root[data-theme="dark"] .homepage-section.section-intro {
  color: var(--fg);
}

:root[data-theme="dark"] .homepage-section.section-features {
  color: var(--fg);
}

@media (max-width: 768px) {
  .homepage-section {
    margin-bottom: 2rem;
  }

  .section-content {
    padding: 0 1rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .homepage-section.section-hero .section-title {
    font-size: 2.5rem;
  }

  .homepage-section.section-hero {
    min-height: 300px;
  }

  .homepage-section.section-intro,
  .homepage-section.section-features,
  .homepage-section.section-how_it_works,
  .homepage-section.section-cta,
  .homepage-section.section-custom {
    padding: 2rem 1rem;
  }
}

/* Combined Search and Categories Section */
.search-and-categories-section {
  background: var(--bg);
  position: relative;
}

/* Search Section Styles */
.search-section {
  background: var(--bg-secondary);
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}

.categories-and-codes-content {
  padding: 3rem 0;
  background: var(--bg);
}

.search-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 2rem;
}

.search-form {
  width: 100%;
}

.search-input-group {
  display: flex;
  gap: 0;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.search-input {
  flex: 1;
  padding: 1rem 1.5rem;
  border: none;
  font-size: 1.125rem;
  background: white;
  color: #1f2937;
  outline: none;
}

.search-input::placeholder {
  color: #6b7280;
}

.search-button {
  padding: 1rem 2rem;
  background: var(--accent);
  color: white;
  border: none;
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.search-button:hover {
  background: #dc2626;
}

/* Dark theme search adjustments */
:root[data-theme="dark"] .search-input {
  background: #374151;
  color: white;
  border: 1px solid #4b5563;
}

:root[data-theme="dark"] .search-input::placeholder {
  color: #9ca3af;
}

/* Search Results Styles */
.search-results {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.search-results-header {
  margin-bottom: 2rem;
  text-align: center;
}

.search-results-header h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--fg);
  margin: 0;
}

.search-section-results {
  margin-bottom: 3rem;
}

.search-section-results h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.5rem;
}

.search-codes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.search-code-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  overflow: hidden;
  transition: all 0.2s ease;
}

.search-code-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.search-code-item .netflix-link {
  display: block;
  padding: 1.5rem;
  text-decoration: none;
  color: var(--fg);
}

.search-code-item .code-number {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.search-code-item .code-title {
  display: block;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.search-code-item .code-category {
  display: block;
  font-size: 0.875rem;
  color: var(--fg-secondary);
  font-style: italic;
}

.search-categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

.search-category-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  overflow: hidden;
  transition: all 0.2s ease;
}

.search-category-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.search-category-item .category-link {
  display: block;
  padding: 1.5rem;
  text-decoration: none;
  color: var(--fg);
}

.search-category-item .category-name {
  display: block;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.5rem;
}

.search-category-item .category-count {
  display: block;
  font-size: 0.875rem;
  color: var(--fg-secondary);
}

.no-results {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--bg-secondary);
  border-radius: 0.75rem;
  border: 1px solid var(--border);
}

.no-results h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 1rem;
}

.no-results p {
  color: var(--fg-secondary);
  font-size: 1.125rem;
}

@media (max-width: 768px) {
  .search-container {
    padding: 0 1rem;
  }

  .search-input-group {
    flex-direction: column;
    border-radius: 0.5rem;
  }

  .search-button {
    border-radius: 0;
  }

  .search-results {
    padding: 2rem 1rem;
  }

  .search-codes-grid {
    grid-template-columns: 1fr;
  }

  .search-categories-grid {
    grid-template-columns: 1fr;
  }
}

/* Trix Rich Text Editor Styles */
.trix-editor {
  min-height: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  padding: 1rem;
  color: var(--fg);
  line-height: 1.6;
}

.trix-editor:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.1);
}

/* Dark theme support for Trix */
:root[data-theme="dark"] .trix-editor {
  background: var(--bg-card);
  color: var(--fg);
}

:root[data-theme="dark"] trix-toolbar {
  background: var(--bg-secondary);
  border-color: var(--border);
}

:root[data-theme="dark"] trix-toolbar .trix-button {
  color: var(--fg);
  background: transparent;
}

:root[data-theme="dark"] trix-toolbar .trix-button:hover {
  background: var(--bg);
}

:root[data-theme="dark"] trix-toolbar .trix-button.trix-active {
  background: var(--accent);
  color: white;
}

/* Rich text content styling in frontend */
.section-text h1,
.section-text h2,
.section-text h3,
.section-text h4,
.section-text h5,
.section-text h6 {
  margin-top: 1.5em;
  margin-bottom: 0.75em;
  font-weight: 600;
}

.section-text p {
  margin-bottom: 1em;
}

.section-text ul,
.section-text ol {
  margin-bottom: 1em;
  padding-left: 2em;
}

.section-text li {
  margin-bottom: 0.5em;
}

.section-text blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 1rem;
  margin: 1.5em 0;
  font-style: italic;
  color: var(--fg-secondary);
}

.section-text a {
  color: var(--accent);
  text-decoration: underline;
}

.section-text a:hover {
  color: var(--accent-hover);
}

.section-text strong {
  font-weight: 600;
}

.section-text em {
  font-style: italic;
}

/* Dark Mode Specific Improvements */
:root[data-theme="dark"] {
  /* Better contrast for form elements */
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] select {
  background: var(--bg-secondary);
  border-color: var(--border);
  color: var(--fg);
}

:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder {
  color: var(--muted);
}

:root[data-theme="dark"] input:focus,
:root[data-theme="dark"] textarea:focus,
:root[data-theme="dark"] select:focus {
  background: var(--bg-card);
  border-color: var(--accent);
}

/* Dark mode table improvements */
:root[data-theme="dark"] table {
  background: var(--bg-card);
}

:root[data-theme="dark"] th {
  background: var(--bg-secondary);
  color: var(--fg);
}

:root[data-theme="dark"] tr:hover {
  background: var(--bg-secondary);
}

/* Dark mode code blocks */
:root[data-theme="dark"] pre {
  background: var(--bg-secondary);
  border-color: var(--border);
}

:root[data-theme="dark"] code {
  color: var(--fg);
}

/* Dark mode search improvements */
:root[data-theme="dark"] .search-input-group {
  background: var(--bg-card);
  border-color: var(--border);
}

:root[data-theme="dark"] .search-input {
  color: var(--fg);
}

:root[data-theme="dark"] .search-input::placeholder {
  color: var(--muted);
}

/* Dark mode hero section improvements */
:root[data-theme="dark"] .hero,
:root[data-theme="dark"] .hero * {
  color: white !important;
}

/* Dark mode homepage content improvements */
:root[data-theme="dark"] .homepage-content h1,
:root[data-theme="dark"] .homepage-content h2,
:root[data-theme="dark"] .homepage-content h3 {
  color: var(--fg);
}

:root[data-theme="dark"] .homepage-content h1 {
  color: var(--accent) !important;
}

:root[data-theme="dark"] .homepage-content p,
:root[data-theme="dark"] .homepage-content li {
  color: var(--fg-secondary);
}

/* Dark mode admin improvements */
:root[data-theme="dark"] .admin-card {
  background: var(--bg-card);
  border-color: var(--border);
}

:root[data-theme="dark"] .admin-card:hover {
  border-color: var(--accent);
}

/* Dark mode form improvements */
:root[data-theme="dark"] form {
  background: var(--bg-card);
  border-color: var(--border);
}

:root[data-theme="dark"] fieldset {
  border-color: var(--border);
}

:root[data-theme="dark"] legend {
  color: var(--fg);
}

/* Dark mode link improvements */
:root[data-theme="dark"] a {
  color: var(--link);
}

:root[data-theme="dark"] a:hover {
  color: var(--accent);
}

/* Dark mode category and code card improvements */
:root[data-theme="dark"] .category-card,
:root[data-theme="dark"] .code-card,
:root[data-theme="dark"] .blog-card {
  background: var(--bg-card);
  border-color: var(--border);
}

:root[data-theme="dark"] .category-card:hover,
:root[data-theme="dark"] .code-card:hover,
:root[data-theme="dark"] .blog-card:hover {
  border-color: var(--accent);
}

/* Ensure proper text contrast in dark mode */
:root[data-theme="dark"] .category-card h3,
:root[data-theme="dark"] .code-card h3,
:root[data-theme="dark"] .blog-card h3 {
  color: var(--accent);
}

:root[data-theme="dark"] .category-card p,
:root[data-theme="dark"] .code-card p,
:root[data-theme="dark"] .blog-card p {
  color: var(--fg-secondary);
}

/* Dark mode empty state */
:root[data-theme="dark"] .empty-state {
  background: var(--bg-secondary);
  border-color: var(--border);
  color: var(--muted);
}

/* Dark mode section headers */
:root[data-theme="dark"] section h2 {
  color: var(--fg);
  border-bottom-color: var(--accent);
}

/* Dark mode article improvements */
:root[data-theme="dark"] article {
  background: var(--bg-card);
  border-color: var(--border);
}

:root[data-theme="dark"] article h1 {
  color: var(--fg);
}

:root[data-theme="dark"] article p[itemprop="abstract"],
:root[data-theme="dark"] article p[itemprop="description"] {
  color: var(--fg-secondary);
}