:root {
    --bg-dark: #070707;
    --bg-card: #0f0f11;
    --primary: #ffffff; /* Active filter color */
    --primary-hover: #e0e0e0;
    --text-main: #ffffff;
    --text-dim: #888888;
    --border-color: rgba(255, 255, 255, 0.08);
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Manrope', sans-serif;
}

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

html {
    background-color: var(--bg-dark);
}

body {
    background-color: transparent;
    color: var(--text-main);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(125% 125% at 50% 10%, #000 40%, #1D00B5 100%);
    z-index: -1;
}

.brand-accent, .brand-highlight {
    color: #7821C3; /* Keep original purple for branding text only */
}

.header {
    padding: 20px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-dark);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

main {
    flex: 1;
    padding: 0 5%;
    max-width: 1600px;
    margin: 0; /* Left align everything */
    width: 100%;
}

.hero {
    text-align: left;
    padding: 20px 0 20px;
}

.hero h1 {
    font-family: 'Inter', var(--font-heading);
    font-weight: 900;
    font-size: 32px;
    margin-bottom: 5px;
    letter-spacing: -1px;
    background: linear-gradient(90deg, #ffffff, #c98cff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    color: var(--text-dim);
    font-size: 14px;
    margin-bottom: 25px;
}

.search-box {
    max-width: 400px;
    margin-bottom: 25px;
}

.search-box input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-box input:focus {
    border-color: #555;
}

.filters {
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: 15px;
    padding-top: 15px;
    padding-bottom: 15px;
    overflow-x: auto;
    white-space: nowrap;
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.filters::-webkit-scrollbar {
    display: none;
}

@property --gradient-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
@property --gradient-angle-offset {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
@property --gradient-percent {
  syntax: "<percentage>";
  initial-value: 5%;
  inherits: false;
}
@property --gradient-shine {
  syntax: "<color>";
  initial-value: white;
  inherits: false;
}

.shiny-cta {
  --shiny-cta-bg: #000000;
  --shiny-cta-bg-subtle: #1a1818;
  --shiny-cta-fg: #ffffff;
  --shiny-cta-highlight: blue;
  --shiny-cta-highlight-subtle: #8484ff;
  --animation: gradient-angle linear infinite;
  --duration: 3s;
  --shadow-size: 2px;
  --transition: 800ms cubic-bezier(0.25, 1, 0.5, 1);
  
  isolation: isolate;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  outline-offset: 4px;
  padding: 8px 18px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 360px;
  color: var(--shiny-cta-fg);
  background: linear-gradient(var(--shiny-cta-bg), var(--shiny-cta-bg)) padding-box,
    conic-gradient(
      from calc(var(--gradient-angle) - var(--gradient-angle-offset)),
      transparent,
      var(--shiny-cta-highlight) var(--gradient-percent),
      var(--gradient-shine) calc(var(--gradient-percent) * 2),
      var(--shiny-cta-highlight) calc(var(--gradient-percent) * 3),
      transparent calc(var(--gradient-percent) * 4)
    ) border-box;
  box-shadow: inset 0 0 0 1px var(--shiny-cta-bg-subtle);
  transition: var(--transition);
  transition-property: --gradient-angle-offset, --gradient-percent, --gradient-shine, opacity, transform;
  flex-shrink: 0;
  opacity: 0.6;
}

.shiny-cta::before,
.shiny-cta::after,
.shiny-cta span::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset-inline-start: 50%;
  inset-block-start: 50%;
  translate: -50% -50%;
  z-index: -1;
}

.shiny-cta:active {
  translate: 0 1px;
}

.shiny-cta::before {
  --size: calc(100% - var(--shadow-size) * 3);
  --position: 2px;
  --space: calc(var(--position) * 2);
  width: var(--size);
  height: var(--size);
  background: radial-gradient(
    circle at var(--position) var(--position),
    white calc(var(--position) / 4),
    transparent 0
  ) padding-box;
  background-size: var(--space) var(--space);
  background-repeat: space;
  mask-image: conic-gradient(
    from calc(var(--gradient-angle) + 45deg),
    black,
    transparent 10% 90%,
    black
  );
  border-radius: inherit;
  opacity: 0.4;
  z-index: -1;
}

.shiny-cta::after {
  --animation: shimmer linear infinite;
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(
    -50deg,
    transparent,
    var(--shiny-cta-highlight),
    transparent
  );
  mask-image: radial-gradient(circle at bottom, transparent 40%, black);
  opacity: 0.6;
}

.shiny-cta span {
  z-index: 1;
}

.shiny-cta span::before {
  --size: calc(100% + 1rem);
  width: var(--size);
  height: var(--size);
  box-shadow: inset 0 -1ex 2rem 4px var(--shiny-cta-highlight);
  opacity: 0;
  transition: opacity var(--transition);
  animation: calc(var(--duration) * 1.5) breathe linear infinite;
}

.shiny-cta,
.shiny-cta::before,
.shiny-cta::after {
  animation: var(--animation) var(--duration),
    var(--animation) calc(var(--duration) / 0.4) reverse paused;
  animation-composition: add;
}

.shiny-cta:is(:hover, :focus-visible, .active) {
  --gradient-percent: 20%;
  --gradient-angle-offset: 95deg;
  --gradient-shine: var(--shiny-cta-highlight-subtle);
  opacity: 1;
  transform: scale(1.05);
}

.shiny-cta:is(:hover, :focus-visible, .active),
.shiny-cta:is(:hover, :focus-visible, .active)::before,
.shiny-cta:is(:hover, :focus-visible, .active)::after {
  animation-play-state: running;
}

.shiny-cta:is(:hover, :focus-visible, .active) span::before {
  opacity: 1;
}

@keyframes gradient-angle {
  to {
    --gradient-angle: 360deg;
  }
}

@keyframes shimmer {
  to {
    rotate: 360deg;
  }
}

@keyframes breathe {
  from, to {
    scale: 1;
  }
  50% {
    scale: 1.2;
  }
}

.filter[data-filter="all"] { --shiny-cta-highlight: #7821C3; --shiny-cta-highlight-subtle: #9c45eb; }
.filter[data-filter="movie"] { --shiny-cta-highlight: #ff416c; --shiny-cta-highlight-subtle: #ff7594; }
.filter[data-filter="4K"] { --shiny-cta-highlight: #f5af19; --shiny-cta-highlight-subtle: #ffc954; }
.filter[data-filter="show"] { --shiny-cta-highlight: #00B4DB; --shiny-cta-highlight-subtle: #4ed9fa; }
.filter[data-filter="Adult"] { --shiny-cta-highlight: #8E2DE2; --shiny-cta-highlight-subtle: #b65cff; }
.filter[data-filter="Anime"] { --shiny-cta-highlight: #38ef7d; --shiny-cta-highlight-subtle: #79f7a8; }

.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    padding-bottom: 60px;
}

.movie-card {
    background: transparent;
    border-radius: 0;
    overflow: visible;
    cursor: pointer;
    border: none;
    position: relative;
    display: flex;
    flex-direction: column;
    transform: translateZ(0);
    will-change: transform;
}

.movie-card:hover .movie-poster {
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(0,0,0,0.8);
}

.poster-container {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 2 / 3;
    background: #111;
    transition: transform 0.2s ease;
}

.movie-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.badges {
    position: absolute;
    bottom: 10px;
    left: 10px;
    display: flex;
    gap: 6px;
    z-index: 2;
}

.badge {
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.movie-info {
    padding: 10px 0 0 0;
}

.movie-title {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 3px;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-meta {
    color: var(--text-dim);
    font-size: 12px;
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
    color: var(--text-dim);
    font-size: 16px;
}

footer {
    text-align: center;
    padding: 30px;
    color: var(--text-dim);
    font-size: 13px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-dark);
}

@media (max-width: 600px) {
    .movies-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 15px;
    }
    .hero h1 {
        font-size: 26px;
    }
}

/* Fix mobile click white layer & add professional hover */
a, button, * {
    -webkit-tap-highlight-color: transparent !important;
}

.movie-card {
    transition: transform 0.3s ease, filter 0.3s ease;
}

.movie-card:hover {
    transform: translateY(-5px);
}

.movie-card:hover .poster-container {
    box-shadow: 0 10px 25px rgba(120, 33, 195, 0.4);
    border-color: rgba(120, 33, 195, 0.6);
}

.movie-card:hover .movie-title {
    color: #c98cff;
}

.admin-edit-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(120, 33, 195, 0.9);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.movie-card:hover .admin-edit-btn {
    opacity: 1;
}

/* Admin Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

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

.admin-modal {
    background: #0f0f11;
    border: 1px solid rgba(120, 33, 195, 0.5);
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 0 40px rgba(120, 33, 195, 0.2);
    transform: translateY(20px);
    animation: slideUp 0.3s forwards;
}

@keyframes slideUp {
    to { transform: translateY(0); }
}

.admin-modal h2 {
    font-family: var(--font-heading);
    margin-bottom: 20px;
    color: #fff;
}

.admin-modal input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #1a1a1c;
    color: #fff;
    font-family: var(--font-body);
    outline: none;
    transition: border-color 0.3s ease;
}

.admin-modal input:focus {
    border-color: #7821C3;
}

.admin-modal button {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    background: #7821C3;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s ease;
}

.admin-modal button:hover {
    background: #5d179b;
}

.admin-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    flex: 1;
    background: #1a1a1c;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    border: 1px solid rgba(255,255,255,0.05);
}

.stat-card i {
    font-size: 24px;
    color: #7821C3;
}

.stat-info h3 {
    font-size: 14px;
    color: #fff;
}

.stat-info p {
    font-size: 12px;
    color: #888;
}

/* Header Add Button */
.header-add-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}
.header-add-btn:hover {
    background-color: #218838;
}

/* Sleek Admin Modal UI */
.sleek-modal {
    background: rgba(20, 20, 22, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    padding: 30px;
    max-width: 400px;
}
.sleek-modal h2 {
    font-size: 22px;
    margin-bottom: 25px;
    text-align: center;
    font-family: var(--font-heading);
}
.sleek-modal input {
    background: #111;
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    padding: 12px 15px;
    border-radius: 8px;
    width: 100%;
    margin-bottom: 15px;
    transition: border-color 0.2s;
}
.sleek-modal input:focus {
    border-color: #7821C3;
    outline: none;
}
.sleek-modal button {
    background: linear-gradient(135deg, #7821C3, #5a1999);
    color: white;
    font-weight: bold;
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    margin-top: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
}
.sleek-modal button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(120, 33, 195, 0.4);
}

/* TMDB Suggestions Dropdown */
.tmdb-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 5px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}
.tmdb-suggestion-item {
    padding: 10px;
    border-bottom: 1px solid #222;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    color: #fff;
    font-size: 14px;
}
.tmdb-suggestion-item:last-child {
    border-bottom: none;
}
.tmdb-suggestion-item:hover {
    background: #2a2a2a;
}
.tmdb-suggestion-item .year {
    color: #888;
    font-size: 12px;
}

/* Simple Footer Styles */
.simple-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 5rem 0;
    background: linear-gradient(to bottom, #5524B7, #380B60);
    color: rgba(255, 255, 255, 0.7);
    margin-top: 3rem;
}
.simple-footer .footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.simple-footer .brand-title {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.simple-footer .footer-copyright {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.875rem;
}
.simple-footer .footer-socials {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.25rem;
}
.simple-footer .footer-socials a {
    transition: transform 0.3s;
}
.simple-footer .footer-socials a:hover {
    transform: translateY(-2px);
}
