/* Show only active tab panels */
.tab-panel{display:none}
.tab-panel.active{display:block}

:root{
  --bg:#0b0f14;
  --bg-elev:rgba(17,22,29,0.7);
  --bg-blur:#0b0f14cc;
  --text:#e6e9ef;
  --muted:#9aa4b2;
  --primary:#7aa2ff;
  --primary-600:#4d82ff;
  --success:#3ddc97;
  --danger:#ff6b6b;
  --ring: rgba(122,162,255,0.5);
  --card:rgba(19,23,36,0.55);
  --card-strong:rgba(22,27,40,0.7);
  --border:rgba(255,255,255,0.08);
  --shadow:0 12px 40px rgba(0,0,0,0.35);
}
:root.theme-light{
  --bg:#f6f8fc;
  --bg-elev:#ffffffc2;
  --bg-blur:#ffffffcc;
  --text:#111827;
  --muted:#667085;
  --primary:#3b82f6;
  --primary-600:#2563eb;
  --success:#16a34a;
  --danger:#dc2626;
  --ring: rgba(59,130,246,0.28);
  --card:#ffffffcf;
  --card-strong:#ffffffec;
  --border:rgba(17,24,39,0.08);
  --shadow:0 12px 40px rgba(2,6,23,0.10);
}

/* Neon Theme */
:root.theme-neon{
  --bg:#0a0a0a;
  --bg-elev:rgba(20,20,20,0.9);
  --bg-blur:#0a0a0acc;
  --text:#00ff88;
  --muted:#00cc66;
  --primary:#00ffff;
  --primary-600:#00cccc;
  --success:#00ff88;
  --danger:#ff0080;
  --ring: rgba(0,255,255,0.5);
  --card:rgba(0,255,136,0.1);
  --card-strong:rgba(0,255,136,0.15);
  --border:rgba(0,255,136,0.3);
  --shadow:0 12px 40px rgba(0,255,136,0.2);
}

/* Retro Theme */
:root.theme-retro{
  --bg:#2d1b2e;
  --bg-elev:rgba(45,27,46,0.8);
  --bg-blur:#2d1b2ecc;
  --text:#ffd700;
  --muted:#ffb347;
  --primary:#ff6b35;
  --primary-600:#e55a2b;
  --success:#32cd32;
  --danger:#ff4757;
  --ring: rgba(255,107,53,0.4);
  --card:rgba(255,215,0,0.1);
  --card-strong:rgba(255,215,0,0.15);
  --border:rgba(255,215,0,0.3);
  --shadow:0 12px 40px rgba(255,215,0,0.2);
}

/* Neon Theme Effects */
.theme-neon body {
  background: 
    radial-gradient(1200px 600px at 10% -10%, rgba(0,255,255,0.3), transparent),
    radial-gradient(900px 500px at 100% 10%, rgba(0,255,136,0.2), transparent),
    var(--bg);
  background-attachment: fixed; /* Fix background during scroll */
  background-size: cover; /* Ensure background covers entire viewport */
  animation: neonPulse 4s ease-in-out infinite alternate;
  will-change: filter; /* Optimize for animations */
}

@keyframes neonPulse {
  0% { 
    filter: hue-rotate(0deg);
    background-position: 0% 0%, 100% 100%;
  }
  100% { 
    filter: hue-rotate(20deg);
    background-position: 0% 0%, 100% 100%;
  }
}

.theme-neon .card {
  background: linear-gradient(180deg, rgba(0,255,136,0.15), transparent 40%), var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow), 0 0 20px rgba(0,255,136,0.1);
  animation: neonGlow 3s ease-in-out infinite alternate;
}

@keyframes neonGlow {
  0% { box-shadow: var(--shadow), 0 0 20px rgba(0,255,136,0.1); }
  100% { box-shadow: var(--shadow), 0 0 30px rgba(0,255,136,0.3); }
}

.theme-neon .header h1 {
  background: linear-gradient(135deg, #00ffff, #00ff88);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: neonTitleGlow 2s ease-in-out infinite alternate;
}

@keyframes neonTitleGlow {
  from { filter: drop-shadow(0 0 5px rgba(0,255,255,0.5)); }
  to { filter: drop-shadow(0 0 20px rgba(0,255,136,0.8)); }
}

/* Retro Theme Effects */
.theme-retro body {
  background: 
    radial-gradient(1200px 600px at 10% -10%, rgba(255,107,53,0.3), transparent),
    radial-gradient(900px 500px at 100% 10%, rgba(255,215,0,0.2), transparent),
    var(--bg);
  background-attachment: fixed; /* Fix background during scroll */
  background-size: cover; /* Ensure background covers entire viewport */
  animation: retroShift 6s ease-in-out infinite alternate;
  will-change: filter; /* Optimize for animations */
}

@keyframes retroShift {
  0% { 
    filter: sepia(0.1) saturate(1.2);
    background-position: 0% 0%, 100% 100%;
  }
  100% { 
    filter: sepia(0.2) saturate(1.4) hue-rotate(5deg);
    background-position: 0% 0%, 100% 100%;
  }
}

.theme-retro .card {
  background: linear-gradient(180deg, rgba(255,215,0,0.15), transparent 40%), var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow), 0 0 15px rgba(255,215,0,0.1);
  animation: retroGlow 4s ease-in-out infinite alternate;
}

@keyframes retroGlow {
  0% { box-shadow: var(--shadow), 0 0 15px rgba(255,215,0,0.1); }
  100% { box-shadow: var(--shadow), 0 0 25px rgba(255,107,53,0.2); }
}

.theme-retro .header h1 {
  background: linear-gradient(135deg, #ffd700, #ff6b35);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: retroTitleGlow 3s ease-in-out infinite alternate;
}

@keyframes retroTitleGlow {
  from { filter: drop-shadow(0 0 5px rgba(255,215,0,0.5)); }
  to { filter: drop-shadow(0 0 20px rgba(255,107,53,0.8)); }
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  min-height:100vh;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(122,162,255,0.20), transparent),
    radial-gradient(900px 500px at 100% 10%, rgba(61,220,151,0.12), transparent),
    var(--bg);
  background-attachment:fixed;
  color:var(--text);
  font-family:'Poppins',system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,'Helvetica Neue',Arial,'Noto Sans',sans-serif;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  overflow-x:hidden;
}

/* Smooth page transitions */
* {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Floating particles animation */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, rgba(122,162,255,0.3), transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(61,220,151,0.2), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.1), transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(122,162,255,0.2), transparent);
  background-repeat: repeat;
  background-size: 200px 200px;
  animation: float 20s linear infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes float {
  0% { transform: translateY(0px) rotate(0deg); }
  100% { transform: translateY(-200px) rotate(360deg); }
}
.app{
  max-width:1100px;
  margin:0 auto;
  padding:24px;
  animation: slideInUp 0.8s ease-out;
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header{
  position:relative;
  display:flex;
  flex-wrap:wrap;
  gap:8px 12px;
  align-items:center;
  justify-content:space-between;
  margin-bottom:6px;
  animation: fadeInDown 0.6s ease-out 0.2s both;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header h1{
  margin:8px 0 0 0;
  font-weight:700;
  letter-spacing:0.3px;
  background: linear-gradient(135deg, var(--primary), var(--success));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    filter: drop-shadow(0 0 5px rgba(122,162,255,0.3));
  }
  to {
    filter: drop-shadow(0 0 20px rgba(122,162,255,0.6));
  }
}

.header p{
  margin:0;
  color:var(--muted);
  flex:1 1 400px;
  animation: fadeIn 0.8s ease-out 0.4s both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Theme toggle */
.btn.theme{border:1px solid var(--border);background:var(--card-strong);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);box-shadow:var(--shadow)}
.btn.theme:hover{border-color:var(--primary);}


/* Form */
.add-form{margin:20px 0}
.field-group{display:flex;gap:10px;align-items:center}
.field-group input, .field-group select{
  background:var(--bg-elev);
  color:var(--text);
  border:1px solid var(--border);
  outline:none;
  padding:12px 14px;
  border-radius:14px;
  transition:border-color .2s, box-shadow .2s, background .2s, transform .08s;
}
.field-group input{flex:1;min-width:0}
.field-group input:focus, .field-group select:focus{
  border-color:var(--primary);
  box-shadow:0 0 0 6px var(--ring);
}
.btn{
  padding:11px 16px;
  border-radius:999px;
  border:1px solid transparent;
  cursor:pointer;
  background:var(--bg-elev);
  color:var(--text);
  position:relative;
  overflow:hidden;
  transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn:active{
  transform:translateY(1px) scale(0.98);
}

.btn.primary{
  background:linear-gradient(135deg, var(--primary), var(--primary-600));
  color:#fff;
  box-shadow:0 8px 26px rgba(77,130,255,0.35);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 8px 26px rgba(77,130,255,0.35); }
  50% { box-shadow: 0 8px 26px rgba(77,130,255,0.6), 0 0 0 10px rgba(77,130,255,0.1); }
}

.btn.primary:hover{
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(77,130,255,0.5);
}

.btn.secondary{
  border-color:var(--border);
  background:var(--card);
}

.btn.secondary:hover{
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.btn.danger{
  background:linear-gradient(135deg, #ff7f7f, var(--danger));
  color:#fff;
  box-shadow:0 8px 26px rgba(255,107,107,0.35);
}

.btn.danger:hover{
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(255,107,107,0.5);
}

.btn.link{
  background:transparent;
  border-color:var(--border);
  color:var(--muted);
  text-decoration:none;
}

.btn.link:hover{
  color: var(--primary);
  border-color: var(--primary);
}

#message{
  min-height:20px;
  margin-top:8px;
  color:var(--muted);
  animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

#message.success{
  color:var(--success);
  animation: successPulse 0.6s ease-out;
}

@keyframes successPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

#message.error{
  color:var(--danger);
  animation: errorShake 0.5s ease-out;
}

@keyframes errorShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Loading animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(122,162,255,0.3);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Tabs */
.tabs{
  display:flex;
  gap:8px;
  margin-top:16px;
  padding:6px;
  background:var(--card-strong);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  border:1px solid var(--border);
  border-radius:999px;
  box-shadow:var(--shadow);
  flex-wrap:wrap;
  animation: slideInUp 0.6s ease-out 0.3s both;
  align-items:center;
}

.tab{
  background:transparent;
  border:none;
  color:var(--muted);
  padding:10px 14px;
  cursor:pointer;
  border-radius:999px;
  transition:all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size:14px;
  white-space:nowrap;
  position:relative;
  overflow:hidden;
}

.tab::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 999px;
}

.tab.active{
  color:#fff;
  background:linear-gradient(135deg, var(--primary), var(--primary-600));
  box-shadow: 0 4px 15px rgba(77,130,255,0.4);
  transform: scale(1.05);
}

.tab:hover:not(.active){
  color: var(--primary);
  transform: translateY(-1px);
}

.tab:active{
  transform:translateY(1px) scale(0.98);
}

.content{margin-top:18px}
.grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap:16px;
  min-height:200px;
  padding-bottom:20px;
}
.grid:empty::after{
  content:"Keine Animes in dieser Liste";
  grid-column:1/-1;
  text-align:center;
  color:var(--muted);
  padding:40px 20px;
  font-style:italic;
}
.card{
  background: linear-gradient(180deg, rgba(122,162,255,0.10), transparent 40%), var(--card);
  border:1px solid var(--border);
  border-radius:18px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  box-shadow:var(--shadow);
  transition:all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position:relative;
  animation: cardSlideIn 0.6s ease-out both;
  height: 100%; /* Ensure all cards have same height */
  min-height: 400px; /* Set minimum height for consistency */
}

/* Card content distribution */
.card {
  justify-content: space-between; /* Distribute content evenly */
}

.card .cover-wrap {
  flex-shrink: 0; /* Cover always same size */
}

.card .title {
  flex-shrink: 0; /* Title takes fixed space */
}

.card .anime-tags {
  flex-shrink: 0; /* Tags take fixed space */
}

.card .termin-display {
  flex-shrink: 0; /* Termin takes fixed space */
}

.card .actions {
  flex-shrink: 0; /* Admin actions take fixed space */
}

.card .rating-display {
  flex-shrink: 0; /* Rating takes fixed space */
}

.card .link-container {
  margin-top: auto; /* Push link button to bottom */
  flex-shrink: 0;
}

@keyframes cardSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.9) rotateX(10deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1) rotateX(0deg);
  }
}

@keyframes cardStaggerIn {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.8) rotateX(15deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1) rotateX(0deg);
  }
}

@keyframes cardBounceIn {
  0% {
    opacity: 0;
    transform: translateY(50px) scale(0.7) rotateX(20deg);
  }
  50% {
    opacity: 0.8;
    transform: translateY(-10px) scale(1.05) rotateX(-5deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotateX(0deg);
  }
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent, rgba(122,162,255,0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.card:hover::before {
  opacity: 1;
}

.card:hover{
  transform:translateY(-8px) scale(1.02);
  box-shadow:0 20px 60px rgba(0,0,0,0.4), 0 0 0 1px rgba(122,162,255,0.2);
  border-color:rgba(122,162,255,0.3);
}

/* 3D Cover Hover Effects */
.cover-wrap:hover .cover {
  transform: rotateY(-8deg) rotateX(4deg) scale(1.05);
  box-shadow: 0 15px 40px rgba(0,0,0,0.3), 0 0 20px rgba(122,162,255,0.2);
}

.cover-wrap:hover .cover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
  opacity: 0.6;
  pointer-events: none;
  transform: translateZ(1px);
}

/* Remove static animation delays - they will be set dynamically */
.cover{
  width:100%;
  aspect-ratio:3/4;
  object-fit:cover;
  background:#0b0e14;
  display:block;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
  transform-style: preserve-3d;
  perspective: 1000px;
}
.cover-wrap{position:relative}
.cover-edit{position:absolute;right:10px;top:10px;z-index:2;border:1px solid var(--border);background:var(--card-strong);color:var(--text);border-radius:999px;padding:6px 9px;cursor:pointer;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);box-shadow:var(--shadow);opacity:0.0;transition:opacity .2s, transform .08s}
.cover-wrap:hover .cover-edit{opacity:1}
.cover-edit:active{transform:translateY(1px)}

.cover-live{position:absolute;left:10px;top:10px;z-index:2;border:1px solid var(--border);background:var(--card-strong);color:var(--text);border-radius:999px;padding:6px 9px;cursor:pointer;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);box-shadow:var(--shadow);opacity:0.0;transition:opacity .2s, transform .08s}
.cover-wrap:hover .cover-live{opacity:1}
.cover-live:active{transform:translateY(1px)}

.cover-rating{position:absolute;left:10px;bottom:10px;z-index:2;border:1px solid var(--border);background:var(--card-strong);color:var(--text);border-radius:999px;padding:6px 9px;cursor:pointer;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);box-shadow:var(--shadow);opacity:0.0;transition:opacity .2s, transform .08s}
.cover-wrap:hover .cover-rating{opacity:1}
.cover-rating:active{transform:translateY(1px)}

/* Rating Button nur für Admins sichtbar */
body:not(.is-admin) .cover-rating {
  display: none;
}


.title{
  font-size:16px;
  font-weight:700;
  margin:12px 14px 4px 14px;
  /* Limit title height to prevent layout shifts */
  height: 2.4em; /* 2 lines maximum */
  line-height: 1.2em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2; /* Standard property for compatibility */
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  word-wrap: break-word;
  hyphens: auto;
}

/* Anime Tag Badges */
.anime-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 8px 12px 0 12px;
  justify-content: center;
}

.anime-tag {
  display: inline-block;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.anime-tag::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.anime-tag:hover::before {
  left: 100%;
}

.anime-tag:hover {
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Tag Color Schemes */
.anime-tag.isekai {
  background: linear-gradient(135deg, #8b5cf6, #a855f7);
  color: white;
  box-shadow: 0 2px 8px rgba(139,92,246,0.3);
}

.anime-tag.action {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  box-shadow: 0 2px 8px rgba(239,68,68,0.3);
}

.anime-tag.romance {
  background: linear-gradient(135deg, #f472b6, #ec4899);
  color: white;
  box-shadow: 0 2px 8px rgba(244,114,182,0.3);
}

.anime-tag.comedy {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: white;
  box-shadow: 0 2px 8px rgba(251,191,36,0.3);
}

.anime-tag.drama {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

.anime-tag.fantasy {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 2px 8px rgba(16,185,129,0.3);
}

.anime-tag.sports {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  color: white;
  box-shadow: 0 2px 8px rgba(6,182,212,0.3);
}

.anime-tag.mystery {
  background: linear-gradient(135deg, #6b7280, #4b5563);
  color: white;
  box-shadow: 0 2px 8px rgba(107,114,128,0.3);
}

.anime-tag.horror {
  background: linear-gradient(135deg, #7c2d12, #991b1b);
  color: white;
  box-shadow: 0 2px 8px rgba(124,45,18,0.3);
}

.anime-tag.slice-of-life {
  background: linear-gradient(135deg, #84cc16, #65a30d);
  color: white;
  box-shadow: 0 2px 8px rgba(132,204,22,0.3);
}

.anime-tag.mecha {
  background: linear-gradient(135deg, #64748b, #475569);
  color: white;
  box-shadow: 0 2px 8px rgba(100,116,139,0.3);
}

.anime-tag.supernatural {
  background: linear-gradient(135deg, #a855f7, #9333ea);
  color: white;
  box-shadow: 0 2px 8px rgba(168,85,247,0.3);
}

/* Enhanced Rating Display with Colorful Stars and Progress */
.rating-display {
  padding: 12px 12px;
  margin: 8px 12px 0 12px;
  font-size: 12px;
  background: linear-gradient(135deg, rgba(245,158,11,0.1), rgba(251,191,36,0.1));
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 12px;
  text-align: center;
  position: relative;
  overflow: hidden;
  /* Immer sichtbar für alle Nutzer */
  display: block !important;
  opacity: 1 !important;
  animation: ratingGlow 2s ease-in-out infinite alternate;
  min-height: 60px; /* Ensure minimum height to prevent overlap */
}

@keyframes ratingGlow {
  from {
    box-shadow: 0 0 5px rgba(245,158,11,0.3);
  }
  to {
    box-shadow: 0 0 15px rgba(245,158,11,0.5);
  }
}

.rating-display::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent, rgba(245,158,11,0.1), transparent);
  opacity: 0.6;
  pointer-events: none;
}

.rating-display .rating-text {
  font-weight: 700;
  color: #f59e0b;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  position: relative;
  z-index: 1;
  margin-bottom: 8px; /* Add space below rating text */
}

.rating-display .rating-stars {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin: 4px 0 8px 0; /* Add more space below stars */
  position: relative;
  z-index: 1;
}

/* 10-star rating display - 2 rows of 5 stars each */
.rating-display .rating-stars-10 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 4px 0 8px 0;
  position: relative;
  z-index: 1;
  font-size: 14px;
  line-height: 1;
}

.rating-display .rating-stars-10 .star-row {
  display: flex;
  justify-content: center;
  gap: 1px;
}

.rating-display .rating-star {
  font-size: 14px;
  color: #f59e0b;
  text-shadow: 0 0 3px rgba(245,158,11,0.5);
  animation: starTwinkle 1.5s ease-in-out infinite;
}

.rating-display .rating-star:nth-child(2) { animation-delay: 0.1s; }
.rating-display .rating-star:nth-child(3) { animation-delay: 0.2s; }
.rating-display .rating-star:nth-child(4) { animation-delay: 0.3s; }
.rating-display .rating-star:nth-child(5) { animation-delay: 0.4s; }

@keyframes starTwinkle {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

.rating-display .rating-progress {
  width: 100%;
  height: 3px;
  background: rgba(245,158,11,0.2);
  border-radius: 2px;
  margin: 4px 0 8px 0; /* Add more space below progress bar */
  overflow: hidden;
  position: relative;
}

.rating-display .rating-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  border-radius: 2px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.rating-display .rating-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: progressShine 2s ease-in-out infinite;
}

@keyframes progressShine {
  0% { left: -100%; }
  100% { left: 100%; }
}

.rating-display .rating-review {
  color: var(--muted);
  font-style: italic;
  font-size: 11px;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}

@keyframes ratingSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


.actions{display:flex;gap:8px;align-items:center;margin:8px 12px 14px 12px}
.actions .btn{flex:1}

/* Link container styling */
.link-container {
  display: flex;
  justify-content: center;
  margin: 8px 12px 14px 12px;
}

.link-container .btn {
  width: 100%;
  text-align: center;
}

/* Anime Details Modal Styling */
.anime-details-modal {
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
}

.anime-details-body {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  padding: 24px;
}

.anime-details-cover {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.anime-details-image {
  width: 200px;
  height: 280px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
}

.anime-details-content {
  flex: 1;
  min-width: 0;
}

.anime-details-name {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 16px 0;
  color: var(--text);
  line-height: 1.3;
}

.anime-details-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--card);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.meta-label {
  font-weight: 600;
  color: var(--muted);
  font-size: 14px;
}

.meta-value {
  font-weight: 600;
  color: var(--text);
  font-size: 14px;
}

.anime-details-genres {
  margin-bottom: 20px;
}

.genres-label {
  display: block;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 14px;
}

.genres-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.genre-tag {
  display: inline-block;
  padding: 4px 8px;
  color: white;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

/* Different colors for different genres */
.genre-tag:nth-child(1) { background: linear-gradient(135deg, #ef4444, #dc2626); }
.genre-tag:nth-child(2) { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.genre-tag:nth-child(3) { background: linear-gradient(135deg, #10b981, #059669); }
.genre-tag:nth-child(4) { background: linear-gradient(135deg, #f59e0b, #d97706); }
.genre-tag:nth-child(5) { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.genre-tag:nth-child(6) { background: linear-gradient(135deg, #ec4899, #db2777); }
.genre-tag:nth-child(7) { background: linear-gradient(135deg, #06b6d4, #0891b2); }
.genre-tag:nth-child(8) { background: linear-gradient(135deg, #84cc16, #65a30d); }
.genre-tag:nth-child(9) { background: linear-gradient(135deg, #f97316, #ea580c); }
.genre-tag:nth-child(10) { background: linear-gradient(135deg, #6366f1, #4f46e5); }

/* Fallback for more than 10 genres */
.genre-tag:nth-child(n+11) { 
  background: linear-gradient(135deg, #64748b, #475569); 
}

.anime-details-description {
  margin-bottom: 24px;
}

.description-label {
  display: block;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 14px;
}

.description-text {
  color: var(--text);
  line-height: 1.6;
  margin: 0;
  font-size: 14px;
  max-height: 120px;
  overflow-y: auto;
  padding-right: 8px;
}

.anime-details-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  width: 100%;
}

.anime-details-cover .anime-details-actions {
  width: 200px;
}

.anime-details-cover .anime-details-actions .btn {
  width: 100%;
  text-align: center;
  padding: 8px 16px;
  font-size: 14px;
}

/* Specific styling for "Zum Anime" button in details modal */
.anime-details-actions .btn.secondary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border-color: #10b981;
  box-shadow: 0 4px 15px rgba(16,185,129,0.3);
  font-weight: 600;
}

.anime-details-actions .btn.secondary:hover {
  background: linear-gradient(135deg, #059669, #047857);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16,185,129,0.4);
}

/* Loading state styling */
.anime-details-modal .loading {
  color: var(--text-secondary);
  font-style: italic;
  opacity: 0.7;
}

.anime-details-actions .btn {
  text-decoration: none !important;
  border: none;
  outline: none;
}

/* Mobile responsive for anime details */
@media (max-width: 768px) {
  .anime-details-body {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .anime-details-image {
    width: 150px;
    height: 210px;
  }
  
  .anime-details-meta {
    grid-template-columns: 1fr;
  }
  
  .anime-details-actions {
    justify-content: center;
  }
}

/* Trailer Modal Styling */
.trailer-modal {
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
}

.trailer-modal-body {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.trailer-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.trailer-player {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  background: var(--bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.trailer-player iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 12px;
}

.trailer-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--text);
}

.trailer-loading p {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--muted);
}

.trailer-info {
  padding: 20px 24px;
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
  margin: 0 24px 24px 24px;
}

.trailer-info h4 {
  margin: 0 0 12px 0;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.trailer-info p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

/* Trailer Button Styling */
.trailer-btn {
  background: linear-gradient(135deg, #ff6b6b, #ee5a52);
  color: #fff;
  box-shadow: 0 8px 26px rgba(255,107,107,0.35);
  animation: trailerPulse 2s infinite;
  position: relative;
  overflow: hidden;
}

.trailer-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s;
}

.trailer-btn:hover::before {
  left: 100%;
}

.trailer-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(255,107,107,0.5);
}

@keyframes trailerPulse {
  0%, 100% { 
    box-shadow: 0 8px 26px rgba(255,107,107,0.35);
  }
  50% { 
    box-shadow: 0 8px 26px rgba(255,107,107,0.6), 0 0 0 10px rgba(255,107,107,0.1);
  }
}

/* Mobile responsive for trailer modal */
@media (max-width: 768px) {
  .trailer-modal {
    max-width: 95vw;
    margin: 10px;
  }
  
  .trailer-info {
    margin: 0 12px 12px 12px;
    padding: 16px;
  }
  
  .trailer-info h4 {
    font-size: 18px;
  }
  
  .trailer-info p {
    font-size: 13px;
  }
}

.footer{margin-top:28px;color:var(--muted)}
.footer a{color:var(--primary)}

/* Modal */
.modal{
  position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,0.7);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);z-index:1000;display:flex;align-items:center;justify-content:center;padding:20px
}
.modal-content{
  background:var(--card-strong);border:1px solid var(--border);border-radius:20px;box-shadow:var(--shadow);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);max-width:500px;width:100%;max-height:90vh;overflow:hidden
}
.modal-header{
  display:flex;align-items:center;justify-content:space-between;padding:20px 24px 16px 24px;border-bottom:1px solid var(--border)
}
.modal-header h3{margin:0;font-weight:600;color:var(--text)}
.modal-close{
  background:none;border:none;color:var(--muted);font-size:24px;cursor:pointer;padding:4px;border-radius:6px;transition:color .2s, background .2s
}
.modal-close:hover{color:var(--text);background:var(--border)}
.modal-body{
  padding:24px;display:flex;gap:20px;align-items:flex-start
}
.modal-cover{
  flex-shrink:0
}
.modal-cover-image{
  width:120px;height:160px;object-fit:cover;border-radius:12px;border:1px solid var(--border)
}
.modal-form{
  flex:1;display:flex;flex-direction:column;gap:16px
}

.modal-field{
  display:flex;
  flex-direction:column;
  gap:8px
}
.modal-form label{
  font-weight:600;color:var(--text);margin-bottom:4px
}
.modal-form input{
  background:var(--bg-elev);color:var(--text);border:1px solid var(--border);outline:none;padding:12px 14px;border-radius:12px;transition:border-color .2s, box-shadow .2s
}
.modal-form input:focus{
  border-color:var(--primary);box-shadow:0 0 0 4px var(--ring)
}
.modal-actions{
  display:flex;gap:12px;justify-content:flex-end
}
.modal-actions .btn{
  min-width:100px
}

.header-actions{display:flex;gap:8px;align-items:center}

/* Stats styling */
.stats{display:flex;gap:24px;margin:16px 0;justify-content:center;flex-wrap:wrap}
.stat-item{display:flex;flex-direction:column;align-items:center;gap:4px;padding:12px 16px;background:var(--card-strong);border-radius:12px;border:1px solid var(--border);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);box-shadow:var(--shadow);transition:all 0.3s ease}
.stat-item:hover{transform:translateY(-2px);box-shadow:0 8px 25px rgba(0,0,0,0.15);border-color:rgba(122,162,255,0.3)}
.stat-number{font-size:24px;font-weight:600;color:var(--accent);text-shadow:0 0 10px rgba(122,162,255,0.3)}
.stat-label{font-size:12px;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.5px;font-weight:500}

/* Admin gating */
body:not(.is-admin) .add-form {
  display: none;
}
body:not(.is-admin) .cover-edit,
body:not(.is-admin) .btn.danger,
body:not(.is-admin) .actions .btn.secondary {
  pointer-events:none;
  opacity:0.5;
}

/* Hide backup buttons for non-admin users */
body:not(.is-admin) .btn.backup,
body:not(.is-admin) .btn.restore {
  display: none;
}

/* Hide edit button (pencil) for non-admin users */
body:not(.is-admin) .cover-edit {
  display: none;
}

/* Hide live button for non-admin users */
body:not(.is-admin) .cover-live {
  display: none;
}

/* Hide all action buttons except details for non-admin users */
body:not(.is-admin) .actions .btn:not(.link) {
  display: none;
}

/* Move dropdown styling */
.move-dropdown-container {
  flex: 1;
  position: relative;
}

.move-dropdown {
  width: 100%;
  background: var(--card-strong);
  color: var(--text);
  border: 1px solid var(--border);
  outline: none;
  padding: 8px 12px;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e6e9ef' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
  padding-right: 30px;
}

.move-dropdown:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring), var(--shadow);
  transform: translateY(-1px);
}

.move-dropdown:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15), var(--shadow);
  border-color: rgba(122,162,255,0.3);
}

.move-dropdown option {
  background: var(--card-strong);
  color: var(--text);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
}

/* Hide dropdown for non-admin users */
body:not(.is-admin) .move-dropdown-container {
  display: none;
}

/* Termin Button Styling */
.cover-termin {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  border: 1px solid var(--border);
  background: var(--card-strong);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 9px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: var(--shadow);
  opacity: 0.0;
  transition: opacity .2s, transform .08s;
  font-size: 12px;
}

.cover-wrap:hover .cover-termin {
  opacity: 1;
}

.cover-termin:active {
  transform: translateY(1px);
}

/* Hide termin button for non-admin users */
body:not(.is-admin) .cover-termin {
  display: none;
}

/* Termin Display in Cards */
.termin-display {
  background: linear-gradient(135deg, rgba(122,162,255,0.15), rgba(61,220,151,0.15));
  border: 1px solid rgba(122,162,255,0.3);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 8px 12px 0 12px;
  font-size: 12px;
  color: var(--text);
  position: relative;
  overflow: hidden;
}

.termin-display::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent, rgba(122,162,255,0.1), transparent);
  opacity: 0.5;
  pointer-events: none;
}

.termin-date {
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 2px;
}

.termin-time {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 2px;
}

.termin-note {
  color: var(--text);
  font-style: italic;
  font-size: 11px;
}

/* Termin Modal Styling */
.modal-form input[type="date"],
.modal-form input[type="time"] {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  outline: none;
  padding: 12px 14px;
  border-radius: 12px;
  transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
}

.modal-form input[type="date"]:focus,
.modal-form input[type="time"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}

/* Termin Status Indicators */
.termin-display.upcoming {
  border-color: rgba(122,162,255,0.4);
  background: linear-gradient(135deg, rgba(122,162,255,0.1), rgba(122,162,255,0.05));
}

.termin-display.today {
  border-color: rgba(61,220,151,0.4);
  background: linear-gradient(135deg, rgba(61,220,151,0.1), rgba(61,220,151,0.05));
  animation: todayPulse 2s ease-in-out infinite;
}

@keyframes todayPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(61,220,151,0.4);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(61,220,151,0.1);
  }
}

.termin-display.overdue {
  border-color: rgba(255,107,107,0.4);
  background: linear-gradient(135deg, rgba(255,107,107,0.1), rgba(255,107,107,0.05));
}

.termin-display.tba {
  border-color: rgba(245,158,11,0.4);
  background: linear-gradient(135deg, rgba(245,158,11,0.1), rgba(245,158,11,0.05));
  animation: tbaPulse 3s ease-in-out infinite;
}

@keyframes tbaPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.02);
  }
}

/* TBA specific styling */
.termin-display.tba .termin-date {
  color: #f59e0b;
  font-style: italic;
}

.termin-display.tba .termin-time {
  display: none; /* Hide time for TBA */
}

/* Modal field visibility control */
.modal-field.hidden {
  display: none;
}

/* Termin type selector styling */
.modal-form select {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  outline: none;
  padding: 12px 14px;
  border-radius: 12px;
  transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
  width: 100%;
}

.modal-form select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}

/* Rating Modal Styles */
.rating-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.stars {
  display: flex;
  gap: 4px;
  cursor: pointer;
}

.star {
  font-size: 24px;
  color: #ddd;
  transition: all 0.2s ease;
  cursor: pointer;
  user-select: none;
}

.star:hover,
.star.active,
.star.hover {
  color: #f59e0b;
  transform: scale(1.1);
}

.star.active {
  filter: drop-shadow(0 0 8px rgba(245,158,11,0.5));
}

.rating-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

.modal-form textarea {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
  outline: none;
  padding: 12px 14px;
  border-radius: 12px;
  transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
}

.modal-form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}


/* FSK Tab Styling */
.tab[data-tab="fsk"] {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: #ffffff;
  border: 1px solid rgba(220, 38, 38, 0.3);
  box-shadow: 0 4px 15px rgba(220, 38, 38, 0.3);
}

.tab[data-tab="fsk"]:hover:not(.active) {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

.tab[data-tab="fsk"].active {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
  transform: scale(1.05);
}

/* FSK Cards have a subtle red tint */
#grid-fsk .card {
  background: linear-gradient(180deg, rgba(220, 38, 38, 0.08), transparent 40%), var(--card);
  border-color: rgba(220, 38, 38, 0.2);
}

#grid-fsk .card:hover {
  border-color: rgba(220, 38, 38, 0.4);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 0 1px rgba(220, 38, 38, 0.3);
}

#grid-fsk .card::before {
  background: linear-gradient(45deg, transparent, rgba(220, 38, 38, 0.1), transparent);
}

/* Mobile Responsive for Termin */
@media (max-width:560px){
  .termin-display {
    margin: 6px 8px 0 8px;
    padding: 6px 10px;
    font-size: 11px;
  }
  
  .cover-termin {
    padding: 4px 7px;
    font-size: 11px;
  }
}

/* Live Status Section - Visible for all users */
.live-status {
  position: fixed;
  top: 20px;
  left: 20px;
  background: linear-gradient(135deg, rgba(16,185,129,0.95), rgba(5,150,105,0.95));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: 16px;
  padding: 12px 16px;
  box-shadow: 0 8px 32px rgba(16,185,129,0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10;
  animation: liveSlideIn 0.6s ease-out;
  max-width: 300px;
}

@keyframes liveSlideIn {
  from {
    opacity: 0;
    transform: translateX(-100px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: #ffffff;
  border-radius: 50%;
  animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.2);
  }
}

.live-text {
  color: #ffffff;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.live-anime {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.live-cover {
  width: 40px;
  height: 53px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2);
  flex-shrink: 0;
}

.live-info {
  flex: 1;
  min-width: 0;
}

.live-info h3 {
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.live-platform {
  color: rgba(255,255,255,0.8);
  font-size: 11px;
  margin: 0;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}


/* Live card styling */
.card[data-live="true"] {
  background: linear-gradient(180deg, rgba(16,185,129,0.2), transparent 40%), var(--card);
  border-color: rgba(16,185,129,0.4);
  box-shadow: 0 8px 32px rgba(16,185,129,0.25), var(--shadow);
}

.card[data-live="true"]:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 60px rgba(16,185,129,0.35), 0 0 0 1px rgba(16,185,129,0.5);
  border-color: rgba(16,185,129,0.6);
}

.card[data-live="true"]::before {
  background: linear-gradient(45deg, transparent, rgba(16,185,129,0.2), transparent);
}



/* Ensure details button (link) is always visible for non-admin */
body:not(.is-admin) .actions .btn.link {
  display: inline-flex;
  pointer-events: auto;
  opacity: 1;
  text-decoration: none;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  justify-content: center;
  align-items: center;
}

/* Hide text for admin users - only show emoji */
body.is-admin .actions .btn.link {
  /* Remove all custom sizing - use default button styles */
  width: auto !important;
  height: auto !important;
  border-radius: 12px !important;
  padding: 8px 12px !important;
  justify-content: center !important;
  align-items: center !important;
  display: inline-flex !important;
  font-size: 14px !important;
  min-width: 40px !important;
}

.btn.admin{border:1px solid var(--border);background:var(--card)}

.btn.backup{
  background:linear-gradient(135deg, #10b981, #059669);
  color:#fff;
  box-shadow:0 8px 26px rgba(16,185,129,0.35);
}

.btn.backup:hover{
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(16,185,129,0.5);
}

.btn.restore{
  background:linear-gradient(135deg, #f59e0b, #d97706);
  color:#fff;
  box-shadow:0 8px 26px rgba(245,158,11,0.35);
}

.btn.restore:hover{
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(245,158,11,0.5);
}

@media (max-width:560px){
  .field-group{flex-direction:column;align-items:stretch}
  .actions{flex-direction:column}
  .modal-body{flex-direction:column;align-items:center;text-align:center}
  .modal-cover-image{width:100px;height:133px}
  .modal-actions{justify-content:center}
  
  /* Mobile card adjustments */
  .card {
    min-height: 350px; /* Slightly smaller on mobile */
  }
  
  .title {
    font-size: 14px; /* Smaller font on mobile */
    height: 2.6em; /* Allow for slightly more text on mobile */
  }
  
  /* Mobile Rating */
  .stars {
    gap: 2px;
  }
  
  .star {
    font-size: 20px;
  }
  
  .rating-display {
    margin: 6px 8px 0 8px;
    padding: 4px 8px;
    font-size: 11px;
  }
  
  /* Mobile Live Status */
  .live-status {
    position: relative;
    top: auto;
    left: auto;
    margin: 12px 0;
    max-width: 100%;
    order: -1;
  }
  
  .live-anime {
    gap: 8px;
  }
  
  .live-cover {
    width: 35px;
    height: 47px;
  }
  
  .live-info h3 {
    font-size: 13px;
  }
  
  .live-platform {
    font-size: 10px;
  }
}

/* Help Button */
.help-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-600));
  border: none;
  color: white;
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(122, 162, 255, 0.3);
  min-width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
}

.help-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(122, 162, 255, 0.4);
  background: linear-gradient(135deg, var(--primary-600), var(--primary));
}

.help-btn:active {
  transform: translateY(0);
}

/* Help Modal */
.help-modal {
  max-width: 600px;
  width: 90%;
}

.help-content {
  padding: 0;
}

.help-section {
  margin-bottom: 24px;
  padding: 20px;
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.help-section:last-child {
  margin-bottom: 0;
}

.help-section h4 {
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.help-section p {
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 16px 0;
}

.help-contacts {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: var(--card-strong);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.contact-item strong {
  color: var(--text);
  font-weight: 600;
  min-width: 80px;
}

.contact-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.contact-link:hover {
  color: var(--primary-600);
  text-decoration: underline;
}

.help-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.help-list li {
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 8px;
  padding-left: 0;
  position: relative;
}

.help-list li:before {
  content: "•";
  color: var(--primary);
  font-weight: bold;
  position: absolute;
  left: -16px;
}

.help-list li strong {
  color: var(--text);
  font-weight: 600;
}

/* Responsive Help Modal */
@media (max-width: 768px) {
  .help-modal {
    max-width: 95%;
    margin: 20px;
  }
  
  .help-section {
    padding: 16px;
  }
  
  .contact-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .contact-item strong {
    min-width: auto;
  }
}
