/*
Theme Name: Obsidian Noir
Author: @bruuhim
Description: Premium dark anime fansub theme - Production Ready
Version: 1.0.26
Text Domain: obsidian-noir
*/

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@400;500;600;700&family=Zain:wght@400;700&display=swap");

:root {
  --bg-main: #0a0a0a;
  --bg-card: #141414;
  --bg-elevated: #1a1a1a;
  --bg-input: #1f1f1f;

  --accent: #e6c9a8;
  --accent-hover: #f2e3d0;
  --accent-dim: #c4a484;
  --accent-glow: rgba(230, 201, 168, 0.3);
  --accent-subtle: rgba(230, 201, 168, 0.1);

  --text-primary: #ffffff;
  --text-secondary: #a0aec0;
  --text-muted: #718096;

  --glass-bg: rgba(10, 10, 10, 0.92);
  --glass-border: rgba(255, 255, 255, 0.1);

  --font-primary: "Inter", sans-serif;
  --font-display: "Outfit", sans-serif;
  --font-arabic: "Zain", sans-serif;

  --container-max: 1400px;
  --gap: 32px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg-card);
}

html::-webkit-scrollbar {
  width: 8px;
}
html::-webkit-scrollbar-track {
  background: var(--bg-card);
}
html::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: var(--radius-pill);
}

body {
  font-family: var(--font-primary);
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

[dir="rtl"] body {
  font-family: var(--font-arabic), var(--font-primary);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
  width: 95%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header Override for Full Width */
/* Header Override for Full Width */
.site-header .container {
  max-width: 100%;
  width: 100%;
  padding: 0 60px; /* Increased from 20px for better spacing */
}

.container-wide {
  width: 95%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

.main-content {
  flex: 1;
}

/* ============================================
   3-COLUMN GRID
   ============================================ */
.releases-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--gap);
  direction: ltr; /* Forced LTR to ensure new EP appears on left */
}

/* Ensure card content remains readable/ltr if needed, or keep rtl for Arabic title */
.release-card {
  direction: ltr;
  text-align: right;
}

@media (min-width: 768px) {
  .releases-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .releases-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 36px;
  }
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  padding: 14px 0;
}

.header-content {
  display: flex;
  /* flex-direction: row-reverse; REVERTED: Logo Left, Controls Right */
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.04em;
  line-height: 1;
}

.logo-accent {
  color: var(--accent);
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: 6px;
}

.main-nav a {
  display: block;
  padding: 10px 18px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.main-nav a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
}

@media (min-width: 768px) {
  .menu-toggle {
    display: none;
  }
  .main-nav {
    display: block !important;
  }
}

@media (max-width: 767px) {
  .header-controls {
    display: none !important;
  }
  .header-content {
    justify-content: center;
  }
}

@media (max-width: 767px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: 16px;
  }
  .main-nav.active {
    display: block;
  }
  .main-nav ul {
    flex-direction: column;
  }
}

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

.user-menu-root {
  position: relative;
}

.user-avatar-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-card);
  transition: transform 0.3s;
}

.user-avatar-btn:hover {
  transform: scale(1.1);
}

.user-avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 180px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s var(--ease-out);
  z-index: 1001;
}

.user-menu-root:hover .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown li {
  list-style: none;
}

.user-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}

.user-dropdown a:hover {
  background: var(--accent-subtle);
  color: var(--accent);
}

/* Auth Buttons in Header */
.auth-btns {
  display: flex;
  gap: 8px;
}

.btn-login {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}

.btn-signup {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: var(--bg-main);
}

/* Header Btns Smaller */
.header-controls .btn-pill {
  padding: 8px 20px;
  font-size: 0.85rem;
}

.search-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
}

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

.search-toggle svg {
  stroke: #ffffff !important;
  stroke-width: 3px !important; /* Thicker for visibility */
  width: 26px !important;
  height: 26px !important;
  display: block !important;
}

/* ============================================
   FOOTER (Glassmorphic & Premium)
   ============================================ */
.site-footer {
  padding: 60px 0 40px;
  background: linear-gradient(
    to top,
    rgba(10, 10, 10, 1) 0%,
    rgba(10, 10, 10, 0.5) 100%
  );
  border-top: 2px solid transparent;
  border-image: linear-gradient(
      to right,
      transparent,
      var(--accent),
      transparent
    )
    1;
  margin-top: 100px;
  position: relative;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 10%;
  right: 10%;
  height: 1px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 100%);
  opacity: 0.3;
}

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

.footer-info p {
  color: var(--text-muted);
  margin-bottom: 20px;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
}

.social-links {
  display: flex;
  gap: 25px;
}

.social-links a {
  color: var(--text-muted);
  font-size: 1.3rem;
  transition: all 0.3s var(--ease-out);
}

.social-links a:hover {
  color: var(--accent);
  transform: translateY(-5px);
  text-shadow: 0 0 15px var(--accent-glow);
}

.footer-attribution {
  font-size: 0.9rem;
  color: var(--text-muted);
  opacity: 0.8;
}

.footer-attribution a {
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

@media (max-width: 992px) {
  .footer-wrap {
    flex-direction: column;
    text-align: center;
    gap: 30px;
  }
}

/* ============================================
   SPOILER TAG
   ============================================ */
.spoiler {
  background: var(--text-primary);
  color: var(--text-primary);
  border-radius: 4px;
  padding: 0 4px;
  cursor: pointer;
  filter: blur(5px);
  transition: all 0.3s ease;
  user-select: none;
}

.spoiler:hover {
  filter: blur(3px);
}

.spoiler.revealed {
  background: rgba(255, 255, 255, 0.1);
  color: inherit;
  filter: none;
  user-select: text;
}

/* ============================================
   SEARCH OVERLAY
   ============================================ */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(10, 10, 10, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s var(--ease-out);
}

.search-overlay.active {
  opacity: 1;
  visibility: visible;
}

.search-overlay-content {
  width: 95%;
  max-width: 650px;
  padding: 20px;
  transform: scale(0.95);
  transition: transform 0.3s var(--ease-out);
}

.search-overlay.active .search-overlay-content {
  transform: scale(1);
}

.search-overlay-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-subtle);
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  cursor: pointer;
  font-size: 1.5rem;
  transition: all 0.3s;
}

.search-overlay-close:hover {
  background: var(--accent);
  color: var(--bg-main);
}

.search-overlay-close svg {
  width: 22px;
  height: 22px;
}

.search-overlay-input {
  width: 100%;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  font-size: 1.15rem;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}

.search-overlay-input:focus {
  border-color: var(--accent);
}

.search-overlay-input::placeholder {
  color: var(--text-muted);
}

.search-overlay-results {
  margin-top: 20px;
  max-height: 50vh;
  overflow-y: auto;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  color: var(--text-primary);
  transition: background 0.2s;
}

.search-result-item:hover {
  background: var(--bg-elevated);
}

.search-result-thumb {
  width: 90px;
  height: 50px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
}

.search-result-title {
  font-weight: 500;
}

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 1s ease;
}

.hero-slide.active {
  opacity: 1;
}

.hero-slide-image {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 30%;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 10, 10, 0.1) 0%,
    rgba(10, 10, 10, 0.4) 50%,
    rgba(10, 10, 10, 0.95) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 0 20px;
  max-width: 800px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  margin-bottom: 12px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  /* Fix long titles */
  overflow-wrap: break-word;
  word-wrap: break-word;
  max-width: 90vw;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.hero-indicators {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 20;
}

.hero-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s;
}

.hero-indicator.active {
  background: var(--accent);
}

/* ============================================
   SECTION TITLE
   ============================================ */
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 36px;
  text-align: center;
}

.section-title::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background: var(--accent);
  margin: 12px auto 0;
  border-radius: var(--radius-pill);
}

.latest-releases {
  padding: 60px 0 100px; /* Added large bottom padding to prevent eating footer */
}

/* ============================================
   CARDS
   ============================================ */
.release-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.4s var(--ease-out);
}

.release-card.revealed {
  opacity: 1;
  transform: translateY(0);
}

.release-card:hover {
  transform: translateY(-10px) scale(1.02) !important;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
  border-color: var(--accent);
}

.card-image {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  transition: all 0.5s var(--ease-out);
}

.release-card:hover .card-image img {
  transform: scale(1.08);
  filter: brightness(1.15);
}

.card-content {
  padding: 18px 20px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
}

.card-title a {
  color: var(--text-primary);
}

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

/* ============================================
   LOAD MORE - FIXED SPACING
   ============================================ */
.load-more-container {
  text-align: center;
  margin-top: 40px; /* 40px from cards */
  margin-bottom: 60px; /* 60px to footer */
}

.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 40px;
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
}

.load-more-btn:hover {
  background: var(--accent);
  color: var(--bg-main);
}

.load-more-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.load-more-btn .spinner {
  width: 18px;
  height: 18px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}

.load-more-btn.loading .spinner {
  display: block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   SINGLE PAGE
   ============================================ */
.single-post-container {
  padding: 40px 0;
}

.post-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  margin-bottom: 28px;
  text-align: center;
}

.post-featured-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 36px;
}

.post-featured-image img {
  width: 100%;
}

.downloads-container,
.comments-wrapper,
.related-episodes {
  width: 95%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
}

.downloads-container {
  margin-bottom: 40px;
}

/* ============================================
   CREDITS
   ============================================ */
.credits-section {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  direction: rtl;
  text-align: right;
}

.credit-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--glass-border);
}

.credit-line:last-child {
  border-bottom: none;
}

.credit-role {
  font-family: var(--font-arabic);
  font-size: 1rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.credit-role i {
  color: var(--accent);
  font-size: 1.1rem;
}

.credit-name {
  font-family: var(--font-arabic);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
}

/* ============================================
   DOWNLOAD BUTTONS
   ============================================ */
.download-section {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  text-align: center;
}

.download-section h2 {
  font-family: var(--font-arabic);
  font-size: 1.25rem;
  margin-bottom: 10px;
  direction: rtl;
}

.download-subtitle {
  font-family: var(--font-arabic);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  direction: rtl;
}

.download-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
}

.download-btn,
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  font-family: var(--font-primary);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
  text-decoration: none;
}

.download-btn:hover,
.btn-pill:hover {
  background: var(--accent);
  color: var(--bg-main);
}

.btn-pill.btn-filled {
  background: var(--accent);
  color: var(--bg-main);
}

/* Specific button colors (Moved below to prevent override) */

/* ============================================
   SHOW/HIDE COMMENTS TOGGLE
   ============================================ */
.comments-wrapper {
  margin-bottom: 48px;
}

.comments-toggle-container {
  text-align: center;
  margin: 40px auto;
  width: fit-content;
}

.comments-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 48px; /* Bigger padding */
  font-family: var(--font-primary);
  font-size: 1.1rem; /* Bigger font */
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.3s var(--ease-out);
}

.comments-toggle-btn:hover {
  background: var(--bg-elevated);
}

.comments-toggle-btn svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s;
}

.comments-toggle-btn.active svg {
  transform: rotate(180deg);
}

/* Comments Section - Hidden by default */
/* Comments Section - Anime.js Target */
.comments-section {
  height: 0;
  opacity: 0;
  overflow: hidden;
  /* Transitions handled by Anime.js */
}

/* .comments-section.visible {
  Class used for state tracking only
} */

/* Animations handled by Anime.js for premium feel */

/* ============================================
   MOBILE BOTTOM NAV (App-like UX)
   ============================================ */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 65px;
  background: var(--glass-bg);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-top: 1px solid var(--glass-border);
  display: none;
  justify-content: space-around;
  align-items: center;
  z-index: 10000;
  padding: 0 10px;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  gap: 4px;
  transition: all 0.3s;
}

.bottom-nav-item i {
  font-size: 1.2rem;
}

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

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

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
  }
  body {
    padding-bottom: 65px; /* Offset for nav */
  }
}

/* ============================================
   ANIMATIONS & GLOW
   ============================================ */
@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(230, 201, 168, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(230, 201, 168, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(230, 201, 168, 0);
  }
}

.modal-submit,
.btn-pill.btn-filled {
  animation: pulse-glow 3s infinite;
}

/* Social links hover animation handled by JS */

.comments-section > h2 {
  font-size: 1.4rem;
  margin-bottom: 20px;
}

/* ============================================
   ANILIST-STYLE COMMENT EDITOR
   ============================================ */
/* ANILIST-STYLE COMMENT EDITOR */
.comment-editor {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 32px; /* Even more "eaten" rounded edges */
  overflow: hidden;
  margin-bottom: 40px;
  padding: 35px; /* More breathing room */
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  transition: all 0.4s var(--ease-out);
}

.comment-editor:focus-within {
  transform: translateY(-2px);
  border-color: var(--accent-subtle);
}

/* Tabs - Minimal AniList Style */
.comment-tabs {
  display: flex;
  border-bottom: 1px solid var(--glass-border);
  background: transparent;
}

.comment-tab {
  padding: 14px 24px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: -1px;
}

.comment-tab.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

.comment-tab:hover:not(.active) {
  color: var(--text-secondary);
}

/* Toolbar - Subtle Gray Icons */
.comment-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--bg-elevated);
}

.toolbar-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted); /* Subtle gray */
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s;
}

.toolbar-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.toolbar-divider {
  width: 1px;
  height: 18px;
  background: var(--glass-border);
  margin: 5px 8px;
}

/* Textarea - More Padding */
.comment-textarea-wrapper {
  position: relative;
}

.comment-textarea {
  width: 100%;
  min-height: 140px;
  padding: 24px; /* Increased padding */
  background: var(--bg-input);
  border: none;
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 0.95rem;
  line-height: 1.7;
  resize: vertical;
  outline: none;
}

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

/* Preview */
.comment-preview {
  display: none;
  min-height: 140px;
  padding: 24px;
  background: var(--bg-input);
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

.comment-preview.active {
  display: block;
}

.comment-textarea-wrapper.preview-mode .comment-textarea {
  display: none;
}

.comment-textarea-wrapper.preview-mode .comment-preview {
  display: block;
}

/* Actions - Beige Send Button */
.comment-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg-elevated);
}

.comment-cancel-btn {
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 500;
  background: transparent;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.comment-cancel-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-muted);
}

/* BEIGE SEND BUTTON */
.comment-save-btn {
  padding: 10px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--bg-main);
  cursor: pointer;
  transition: all 0.2s;
}

.comment-save-btn:hover {
  background: var(--accent-hover);
}

/* Comment List */
.comment-list {
  list-style: none;
}

.comment {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: 24px; /* Much more rounded */
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.comment-body {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.comment-avatar-col {
  flex-shrink: 0;
}

.comment-main {
  flex: 1;
  min-width: 0; /* Prevent overflow */
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.comment-author {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
}

.owner-badge {
  color: var(--accent); /* Matches theme gold */
  font-size: 0.95rem;
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
  filter: drop-shadow(0 0 8px var(--accent-glow));
  vertical-align: middle;
}

.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

/* Arabic Typography */
[lang="ar"],
.download-section h2,
.download-subtitle,
.btn-subs {
  font-family: "Cairo", "Zain", sans-serif !important;
}

/* Gold Glow Download Button */
.download-btn {
  border: 1px solid var(--accent);
  box-shadow: 0 0 10px rgba(230, 201, 168, 0.1);
  transition: all 0.3s ease;
}

/* Specific Colors - Placed after generic to override border-color */
.btn-ddl {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-ddl-alt {
  border-color: var(--accent-dim);
  color: var(--accent-dim);
}
.btn-watch-ddl {
  border-color: var(--accent);
  color: var(--accent);
}
.btn-watch-ddl-alt {
  border-color: var(--accent-dim);
  color: var(--accent-dim);
}
.btn-telegram {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}
.btn-subs {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

/* HOVER STATES - Black text for visibility */
.btn-ddl:hover,
.btn-watch-ddl:hover,
.btn-telegram:hover,
.btn-subs:hover {
  background: var(--accent) !important;
  color: #000 !important;
}

.btn-ddl-alt:hover,
.btn-watch-ddl-alt:hover {
  background: var(--accent-dim) !important;
  color: #000 !important;
}

/* Ensure no green/purple leaks */
.btn-watch-ddl,
.btn-watch-ddl-alt,
.btn-telegram,
.btn-subs {
  background: transparent;
}

.download-btn:hover {
  box-shadow: 0 0 20px rgba(230, 201, 168, 0.3);
  transform: translateY(-2px);
}

/* Custom Confirmation Modal */
.custom-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.custom-modal.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  max-width: 400px;
  width: 90%;
  padding: 30px;
  text-align: center;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.custom-modal.visible .modal-content {
  transform: scale(1);
}

.modal-title {
  color: var(--accent);
  margin-bottom: 12px;
  font-family: "Outfit", sans-serif;
}

.modal-message {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Comment Editor Layout - Merged above */

.comment-editor-flex {
  display: flex;
  gap: 24px; /* More space for the avatar */
  align-items: flex-start;
}

.comment-author-avatar {
  flex-shrink: 0;
  margin-top: 5px;
}

.comment-author-avatar img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--glass-border);
}

.comment-editor-main {
  flex: 1;
  min-width: 0;
}

/* YouTube Style Reply Form */
#respond.is-replying {
  margin: 15px 0 20px 56px;
  background: rgba(255, 255, 255, 0.03);
  padding: 24px;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  animation: slideDown 0.3s ease;
}

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

#respond.is-replying .comment-author-avatar img {
  width: 32px;
  height: 32px;
}

/* Edit Form Container (Matches Main Editor via .comment-editor class) */
.edit-comment-container {
  margin: 14px 0;
  /* Redundant padding/bg removed since .comment-editor class handles it */
}

.edit-comment-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 10px;
}

.btn-danger {
  background: #ff4d4d !important;
  border-color: #ff4d4d !important;
}

.btn-danger:hover {
  background: #ff3333 !important;
  box-shadow: 0 0 15px rgba(255, 77, 77, 0.3);
}

/* Base Author Color */
.comment-author {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

/* Explicit Role Colors (Specific to the comment body to avoid inheritance) */
.comment-contributor > .comment-body .comment-author {
  color: #38bdf8 !important; /* Premium Blue for Contributor */
}

.comment-owner > .comment-body .comment-author {
  color: var(--accent) !important; /* Beige for owner */
}

.contributor-badge {
  color: #38bdf8;
  font-size: 0.95rem;
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.4));
  vertical-align: middle;
}

.comment-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Inline Edit Editor */
.edit-comment-form {
  margin: 12px 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 12px;
}

.edit-comment-textarea {
  width: 100%;
  min-height: 100px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.92rem;
  resize: vertical;
  margin-bottom: 12px;
  outline: none;
}

.edit-comment-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.comment-content {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 8px;
}

.comment-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}

.comment-footer-divider {
  width: 1px;
  height: 12px;
  background: var(--glass-border);
}

.comment-reply-link,
.comment-edit-link,
.comment-delete-link {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s;
}

.comment-reply-link:hover,
.comment-edit-link:hover {
  color: var(--accent);
}

.comment-delete-link:hover {
  color: #ff4d4d;
}

/* Spoiler Styling */
.spoiler {
  background: rgba(255, 255, 255, 0.1);
  color: transparent;
  filter: blur(4px);
  padding: 0 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}

.spoiler:hover {
  background: rgba(255, 255, 255, 0.15);
}

.spoiler.revealed {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  filter: blur(0);
  user-select: text;
}

/* Redesigned Connect with Google */
.btn-social-login.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  padding: 14px;
  border-radius: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 20px;
  width: 100%;
}

.btn-social-login.btn-google i {
  color: #ea4335; /* Google Red for icon only */
  font-size: 1.2rem;
}

.btn-social-login.btn-google:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--gold-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.1);
}

/* Custom Notifications (Toasts) */
.obsidian-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.obsidian-toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 400px;
  background: rgba(20, 20, 20, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toastSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.3s ease;
}

.obsidian-toast.success { border-left: 3px solid #4ade80; }
.obsidian-toast.error { border-left: 3px solid #ef4444; }
.obsidian-toast.info { border-left: 3px solid var(--gold-primary); }

.obsidian-toast i {
  font-size: 1.2rem;
}

.obsidian-toast.success i { color: #4ade80; }
.obsidian-toast.error i { color: #ef4444; }
.obsidian-toast.info i { color: var(--gold-primary); }

.obsidian-toast-content {
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.4;
}

.obsidian-toast.fade-out {
  opacity: 0;
  transform: translateX(30px);
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 768px) {
  .obsidian-toast-container {
    top: auto;
    bottom: 90px;
    left: 20px;
    right: 20px;
  }
  .obsidian-toast {
    min-width: 0;
    width: 100%;
  }
}


.comment .children {
  list-style: none;
  margin-top: 16px;
  padding-left: 20px;
  border-left: 2px solid var(--glass-border);
}

/* ============================================
   RELATED EPISODES
   ============================================ */
.related-episodes {
  margin-top: 10px; /* Brighter connection to comments */
  padding-top: 40px;
  margin-bottom: 80px; /* Space out from footer */
  border-top: 1px solid var(--glass-border);
}

.related-episodes > h2 {
  font-size: 1.4rem;
  margin-bottom: 28px;
  text-align: center;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

@media (max-width: 767px) {
  #back-to-top {
    display: none !important;
  }

  .comment-editor-flex {
    flex-direction: column;
    gap: 15px;
  }

  .comment-author-avatar {
    margin: 0 auto;
  }

  /* Redesigned Mobile Comment Editor - Centered & Premium */
  .edit-comment-container,
  .comment-editor {
    width: 92% !important;
    max-width: 500px !important;
    margin: 30px auto !important;
    padding: 25px !important;
    box-sizing: border-box !important;
    border: 1px solid var(--glass-border);
    background: rgba(20, 20, 20, 0.95) !important;
    backdrop-filter: blur(12px);
    border-radius: 20px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: block !important;
  }

  .comment-main {
    padding-left: 0 !important;
    width: 100% !important;
    display: flex;
    flex-direction: column;
    align-items: center; /* Center content in the main col */
  }

  .comment-textarea-wrapper {
    width: 100% !important;
    margin: 15px 0;
  }

  .edit-comment-textarea {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 12px !important;
    padding: 12px !important;
    width: 100% !important;
  }

  .related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 0 20px !important; /* Final edge spacing fix */
  }

  .comment-editor {
    width: 100% !important;
    padding: 15px !important;
  }

  .comment-tabs,
  .comment-toolbar {
    flex-wrap: wrap !important;
    gap: 5px !important;
  }

  .toolbar-btn {
    padding: 6px 10px !important;
    font-size: 13px !important;
  }

  .edit-comment-actions {
    flex-wrap: wrap !important;
    gap: 10px !important;
    justify-content: space-between !important;
  }

  .edit-comment-actions button {
    flex: 1;
    min-width: 100px;
  }
}

@media (min-width: 768px) {
  .related-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.related-card {
  position: relative;
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.4s var(--ease-out);
  color: var(--text-primary);
}

.related-card.revealed {
  opacity: 1;
  transform: translateY(0);
}

.related-card:hover {
  border-color: var(--accent);
  transform: translateY(-6px) !important;
}

.related-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.related-card-title {
  padding: 12px 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-card);
  white-space: normal;
  overflow: visible;
  line-height: 1.4;
  min-height: 60px;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--glass-border);
  padding: 36px 0;
  text-align: center;
  margin-top: auto;
}

.site-footer p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.site-footer a {
  color: var(--accent);
}

.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 2px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 100;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--accent);
  color: var(--bg-main);
}

/* ============================================
   ERROR PAGE
   ============================================ */
.error-404 {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.error-404-number {
  font-family: var(--font-display);
  font-size: clamp(8rem, 25vw, 14rem);
  font-weight: 700;
  color: var(--accent);
  opacity: 0.15;
}

/* ============================================
   SKELETON
   ============================================ */
.skeleton {
  background: var(--bg-card);
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.04),
    transparent
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .comments-section {
    max-height: none !important;
  }
}

/* Login Prompt for Comments */
.login-prompt {
  background: var(--bg-card);
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 60px 20px;
  text-align: center;
  margin-bottom: 40px;
}

.login-prompt-content i {
  font-size: 3rem;
  color: var(--accent-subtle);
  margin-bottom: 20px;
}

.login-prompt-content p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.login-prompt-btns {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.login-prompt-btns .btn-pill {
  min-width: 140px;
}

.toolbar-btn i {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.toolbar-btn:hover i {
  color: var(--accent);
}

/* ============================================
   MODALS (Auth & Media)
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s var(--ease-out);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  width: 95%;
  max-width: 440px;
  background: var(--glass-bg);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 40px;
  transform: scale(0.9) translateY(20px);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.9), 0 0 40px rgba(230, 201, 168, 0.05);
}

.modal-overlay.active .modal-container {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  transition: color 0.2s;
}

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

.modal-header {
  text-align: center;
  margin-bottom: 28px;
}

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--accent);
  margin-bottom: 8px;
}

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

/* Form Styles inside Modals */
.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px; /* Increased spacing for Profile Page */
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
  display: block;
}

.modal-input {
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s var(--ease-out);
  width: 100%;
}

.modal-input:focus {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(230, 201, 168, 0.15);
}

.modal-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.modal-submit {
  padding: 16px;
  background: var(--accent);
  color: var(--bg-main);
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 10px;
}

.modal-submit:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px var(--accent-glow);
}

.modal-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.modal-footer a {
  color: var(--accent);
  font-weight: 500;
}

.form-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #ef4444;
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  display: none;
  margin-bottom: 16px;
}

/* ============================================
   ANIMATION CLASSES
   ============================================ */

/* ============================================
   ANIMATION CLASSES
   ============================================ */
.gsap-reveal {
  opacity: 0;
  transform: translateY(30px);
}

.split-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(100%);
}

/* Profile Page Specifics */
.tab-header {
  margin-bottom: 30px;
}

.tab-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  padding: 24px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.3s var(--ease-out);
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-5px);
  border-color: var(--accent-dim);
}

.stat-icon {
  width: 48px;
  height: 48px;
  background: rgba(230, 201, 168, 0.1);
  color: var(--accent);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

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

.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-secondary);
}

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

.profile-tab-btn.active {
  background: rgba(230, 201, 168, 0.08);
  color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.btn-filled.pulse {
  animation: pulse-glow 2s infinite;
}

/* =========================================
   Profile Page & Avatar Polish (v7.7)
   ========================================= */
.profile-page-container {
  padding-top: 140px;
  padding-bottom: 80px;
  min-height: 90vh;
}

.profile-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 40px;
  align-items: start;
}

@media (max-width: 992px) {
  .profile-layout {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

.profile-sidebar {
  position: sticky;
  top: 120px;
  padding: 40px 30px;
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  text-align: center;
}

.profile-header-mini {
  margin-bottom: 35px;
}

.profile-avatar {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 20px;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50% !important;
  object-fit: cover;
  border: 3px solid #e6c9a8;
  padding: 4px;
  background: rgba(230, 201, 168, 0.05);
  box-shadow: 0 0 20px rgba(230, 201, 168, 0.2);
}

.profile-name {
  margin: 0;
  font-size: 1.4rem;
  color: var(--text-primary);
  font-family: var(--font-display);
}

.profile-username {
  display: block;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.profile-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 30px;
}

.profile-tab-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.profile-tab-btn:hover,
.profile-tab-btn.active {
  background: var(--accent-subtle);
  color: var(--accent);
  border-color: var(--accent);
}

.profile-tab-btn.logout {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.1);
}

.profile-tab-btn.logout:hover {
  background: rgba(255, 107, 107, 0.15);
}

.profile-content {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 50px;
  min-height: 500px;
}

.profile-tab-content {
  display: none;
  animation: fadeIn 0.4s ease;
}

.profile-tab-content.active {
  display: block;
}

.tab-title {
  font-size: 2rem;
  margin-bottom: 35px;
  color: var(--text-primary);
  font-family: var(--font-display);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 25px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.02);
  padding: 35px;
  border-radius: var(--radius-md);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition);
}

.stat-card:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-5px);
}

.stat-value {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 8px;
  font-family: var(--font-display);
}

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

/* Avatar Changer */
.avatar-upload-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-bottom: 45px;
  padding: 40px;
  background: rgba(255, 255, 255, 0.015);
  border-radius: var(--radius-lg);
  border: 2px dashed rgba(230, 201, 168, 0.2);
  transition: var(--transition);
}

.avatar-upload-container:hover {
  border-color: var(--accent);
  background: rgba(230, 201, 168, 0.03);
}

.avatar-preview {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--accent);
  background: var(--bg-card);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-input-wrapper {
  position: relative;
  overflow: hidden;
  display: inline-block;
}

.file-input-wrapper input[type="file"] {
  font-size: 100px;
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  cursor: pointer;
}

.btn-file-select {
  background: var(--accent);
  color: var(--bg-main);
  padding: 12px 28px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  box-shadow: 0 8px 15px var(--accent-glow);
}

.btn-file-select:hover {
  transform: translateY(-2px);
  background: var(--accent-hover);
}

/* Header Avatar Styling */
.user-avatar-link img {
  width: 40px;
  height: 40px;
  border-radius: 50% !important;
  border: 2px solid #e6c9a8;
  padding: 2px;
  background: rgba(230, 201, 168, 0.1);
  object-fit: cover;
  transition: var(--transition);
}

.user-avatar-link:hover img {
  transform: scale(1.1);
  border-color: #ffffff;
  box-shadow: 0 0 15px rgba(230, 201, 168, 0.4);
}

/* Google Login Styles */
.social-login-separator {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 20px 0;
}

.social-login-separator::before,
.social-login-separator::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--glass-border);
}

.social-login-separator span {
  padding: 0 10px;
}

.btn-social-login {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
  text-decoration: none;
  cursor: pointer;
}

.btn-google {
  background: #ffffff;
  color: #1f1f1f;
  border: 1px solid #ddd;
}

.btn-google:hover {
  background: #f1f1f1;
}

.btn-google i {
  color: #DB4437;
}

/* Profile Form Spacing & Layout */
.profile-form label {
  font-weight: 500;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 8px;
}

.subsection-title {
  margin-top: 32px;
  margin-bottom: 20px;
  font-size: 1.1rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 10px;
}
