:root {
  --bg-primary: #090a0f;
  --bg-secondary: #13151f;
  --bg-tertiary: #1b1e2e;
  --accent: #6366f1;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --accent-hover: #4f46e5;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.4);
  --card-bg: #121520;
  --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.7);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Plus Jakarta Sans', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: #040508;
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
}

/* Phone Frame Shell for Premium App Experience */
.phone-frame {
  width: 100%;
  max-width: 440px;
  height: 100vh;
  max-height: 940px;
  background: var(--bg-primary);
  position: relative;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.9), 0 0 20px rgba(99, 102, 241, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

@media (min-width: 441px) {
  .phone-frame {
    border-radius: 36px;
    height: 92vh;
  }
}

.screen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  background: radial-gradient(circle at 50% 0%, #1a103c 0%, var(--bg-primary) 70%);
}

/* Modern Glassmorphism Header */
.app-header {
  height: 65px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(9, 10, 15, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 4px;
}

.logo span {
  font-weight: 300;
}

.header-icons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.admin-link {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 15px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.admin-link:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
  transform: translateY(-2px);
}

/* App Main Body Container */
.app-body {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 90px;
  scroll-behavior: smooth;
}

.app-body::-webkit-scrollbar {
  width: 4px;
}

.app-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}

.view-section {
  display: none;
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.view-section.active {
  display: block;
}

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

/* Cinematic Hero Banner */
.hero-banner {
  margin: 16px 16px 24px 16px;
  height: 220px;
  border-radius: var(--radius-lg);
  overflow: relative;
  position: relative;
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #090a0f 0%, rgba(9, 10, 15, 0.5) 60%, rgba(9, 10, 15, 0.2) 100%);
}

.hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  z-index: 2;
}

.hero-badge {
  display: inline-block;
  background: rgba(99, 102, 241, 0.25);
  border: 1px solid rgba(99, 102, 241, 0.5);
  color: #a5b4fc;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  backdrop-filter: blur(4px);
}

.hero-content h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
  color: #fff;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#hero-genre {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.hero-buttons {
  display: flex;
  gap: 10px;
}

.btn-primary, .btn-secondary {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border: none;
  transition: all 0.25s ease;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
}

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

/* Category Slider */
.categories-scroll {
  display: flex;
  gap: 8px;
  padding: 0 16px 16px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.categories-scroll::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  padding: 8px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  border-radius: 30px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.25s ease;
}

.cat-pill.active, .cat-pill:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

/* Section Titles */
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  margin-bottom: 12px;
}

.section-title h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text-main);
  position: relative;
  padding-left: 10px;
}

.section-title h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  width: 3px;
  background: var(--accent);
  border-radius: 3px;
}

.see-all {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.see-all:hover {
  text-decoration: underline;
}

/* Anime Grid & Cards */
.anime-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding: 0 16px 20px 16px;
}

.anime-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
}

.anime-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.5);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 15px rgba(99, 102, 241, 0.2);
}

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

.anime-card:hover img {
  transform: scale(1.05);
}

.anime-card-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.anime-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.anime-genre {
  font-size: 11px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Search Bar */
.search-bar-container {
  margin: 16px;
  position: relative;
}

.search-bar-container i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}

.search-bar-container input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 12px 16px 12px 44px;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: all 0.3s ease;
}

.search-bar-container input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
}

/* Profile View Styles */
.profile-auth-box {
  margin: 30px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.profile-avatar-placeholder {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--accent);
  margin-bottom: 16px;
}

.profile-auth-box h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.profile-header {
  margin: 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.profile-info {
  flex: 1;
}

.profile-info h3 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.profile-info p {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.badge-vip {
  display: inline-block;
  background: rgba(234, 179, 8, 0.2);
  border: 1px solid rgba(234, 179, 8, 0.4);
  color: #fde047;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
}

.profile-menu-list {
  margin: 0 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.profile-menu-item {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.2s;
}

.profile-menu-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.profile-menu-item i:first-child {
  color: var(--accent);
  font-size: 16px;
  width: 20px;
}

/* Video Modal / Watch Screen */
.video-modal {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 8, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.3s ease;
}

.video-modal-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-y: auto;
}

.close-modal-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s;
}

.close-modal-btn:hover {
  background: var(--accent);
}

.video-container {
  width: 100%;
  background: #000;
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}

.video-container video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  display: block;
  outline: none;
}

.video-details {
  padding: 20px;
  flex: 1;
}

/* Comments Section Styling */
.comments-section {
  margin-top: 24px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}

.comments-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.comment-input-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 20px;
}

.comment-input-box textarea {
  width: 100%;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 13px;
  outline: none;
  resize: none;
  min-height: 60px;
}

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

.comment-action-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 8px;
  border-top: 1px solid var(--border-color);
  padding-top: 8px;
}

.comment-submit-btn {
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.comment-submit-btn:hover {
  opacity: 0.9;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comment-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  gap: 10px;
}

.comment-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.comment-content-area {
  flex: 1;
}

.comment-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.comment-username {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}

.comment-time {
  font-size: 10px;
  color: var(--text-muted);
}

.comment-text {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.4;
  word-break: break-word;
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: rgba(9, 10, 15, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-muted);
  gap: 4px;
  transition: color 0.3s ease;
  font-size: 11px;
  font-weight: 600;
  width: 25%;
}

.nav-item i {
  font-size: 18px;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-item.active {
  color: var(--accent);
}

.nav-item.active i {
  transform: translateY(-2px);
  color: var(--accent);
  filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.6));
}

/* Admin Dashboard Specific Styles */
.admin-body {
  background: #040508;
}

.admin-container {
  padding: 20px;
}

.admin-container h3 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group input, .form-group textarea {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus, .form-group textarea:focus {
  border-color: var(--accent);
}

.submit-btn {
  width: 100%;
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  transition: transform 0.2s;
}

.submit-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.admin-anime-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.admin-anime-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-anime-item img {
  width: 45px;
  height: 45px;
  object-fit: cover;
  border-radius: 6px;
}

.admin-anime-info {
  flex: 1;
}

.admin-anime-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.delete-btn {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.delete-btn:hover {
  background: #ef4444;
  color: #fff;
}
