:root {
  --primary: #8a2be2;
  --primary-light: #9d4edd;
  --secondary: #ff6b6b;
  --text-light: #f8f9fa;
  --text-dark: #212529;
  --bg-light: #ffffff;
  --bg-dark: #121212;
  --card-light: #f8f9fa;
  --card-dark: #1e1e1e;
  --accent1: #00bcd4;
  --accent2: #ff9a8b;
  --accent3: #64dfdf;
  --glow-light: rgba(138, 43, 226, 0.4);
  --glow-dark: rgba(157, 78, 221, 0.6);
  --shadow-light: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-dark: 0 4px 20px rgba(0, 0, 0, 0.25);
  --gradient-light: linear-gradient(135deg, #8a2be2, #9d4edd);
  --gradient-dark: linear-gradient(135deg, #6a0dad, #8a2be2);
  --transition: all 0.3s ease;
  --border-radius: 12px;
}


body {
  --bg: var(--bg-light);
  --text: var(--text-dark);
  --card-bg: var(--card-light);
  --glow: var(--glow-light);
  --shadow: var(--shadow-light);
  --gradient: var(--gradient-light);
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Montserrat', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  transition: var(--transition);
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body.dark-theme {
  --bg: var(--bg-dark);
  --text: var(--text-light);
  --card-bg: var(--card-dark);
  --glow: var(--glow-dark);
  --shadow: var(--shadow-dark);
  --gradient: var(--gradient-dark);
}

h1, h2, h3, h4 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}


header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  background: rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: var(--transition);
}

body.dark-theme header {
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
}

.logo {
  height: 50px;
  display: flex;
  align-items: center;
  color: var(--primary);
}

.nav-links {
  display: flex;
  gap: 25px;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  position: relative;
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient);
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}


.user-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background: rgba(138, 43, 226, 0.1);
  transform: rotate(15deg);
}

.search-container {
  position: relative;
  transition: var(--transition);
}

.search-input {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 8px 15px 8px 35px;
  color: var(--text);
  width: 180px;
  transition: var(--transition);
  font-family: 'Montserrat', sans-serif;
}

body.dark-theme .search-input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.search-input:focus {
  width: 240px;
  outline: none;
  box-shadow: 0 0 0 2px var(--glow);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text);
  opacity: 0.6;
  pointer-events: none;
}


.btn {
  background: var(--gradient);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: 'Montserrat', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.9rem;
  box-shadow: 0 4px 15px var(--glow);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--glow);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
  box-shadow: none;
}

.btn-outline:hover {
  background: var(--gradient);
  color: white;
  box-shadow: 0 6px 20px var(--glow);
}

.read-btn {
  background-color: rgba(255, 255, 255, 0.2);
  color: gold;
  border: none;
}

.read-btn:hover {
  border: 2px solid gold;
}

.add-btn {
  background-color: rgba(255, 255, 255, 0.2);
  color: gold;
  border: 2px solid gold;
}

.add-btn:hover {
  background-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}


.genre {
  background: rgba(138, 43, 226, 0.2);
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  font-weight: 500;
}

.genre i {
  margin-right: 8px;
  color: #ffcc00;
}

.rating {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 13px;
  color: gold;
  font-weight: 500;
  font-size: 16px;
}

.rating i {
  margin-left: 13px;
  color: #ffcc00;
}


section {
  padding: 60px 0;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section-title {
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  font-size: 2.2rem;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--gradient);
  border-radius: 2px;
}


.hero {
  position: relative;
  top: 15vh;
  height: 60vh;
  min-height: 350px;
  overflow: hidden;
  margin-bottom: 50px;
  display: flex;
  align-items: center;
  color: white;
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transition: opacity 1s ease;
  z-index: 1;
}

.hero-background::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(0deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.3) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

.hero-content-inner {
  max-width: 600px;
  transition: transform 0.5s ease;
}

.hero-badge {
  display: inline-block;
  background-color: rgba(255, 204, 0, 0.9);
  color: #111;
  font-weight: bold;
  padding: 6px 12px;
  border-radius: 4px;
  margin-bottom: 0px;
  font-size: 14px;
  animation: fadeInDown 0.5s ease;
}

.hero-story-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.1;
  font-family: 'Playfair Display', serif;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
  transition: opacity 0.5s ease;
}

.hero-story-desc {
  font-size: 1.2rem;
  margin-bottom: 24px;
  max-width: 90%;
  line-height: 1.6;
  transition: opacity 0.5s ease;
}

.hero-meta {
  display: flex;
  align-items: center;
  margin-bottom: 32px;
  gap: 24px;
}

.hero-actions {
  display: flex;
  gap: 16px;
}


.hero-carousel {
  position: relative;
  width: 100%;
  height: 100%;
}

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.6s ease-in-out;
  overflow: hidden;
  cursor: pointer;
  background-size: cover;
  background-position: center;
}

.carousel-slide.active {
  opacity: 1;
  z-index: 1;
}

.slide-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  transform: scale(1);
  transition: transform 8s ease;
}

.carousel-slide.active .slide-background {
  transform: scale(1.05);
}


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

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

.carousel-indicator.active, .indicator.active {
  background-color: #ffcc00;
  width: 30px;
  border-radius: 5px;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  transition: all 0.3s ease;
  padding: 10px;
}

.prev-arrow {
  left: 20px;
}

.next-arrow {
  right: 20px;
}

.hero:hover .carousel-arrow {
  opacity: 0;
}

.carousel-arrow:hover {
  background-color: rgba(0, 0, 0, 0.8);
  opacity: 1 !important;
}


.stories-carousel {
  position: relative;
  overflow: hidden;
  padding: 20px 0;
}

.carousel-container {
  display: flex;
  gap: 25px;
  padding: 20px 0;
  transition: transform 0.5s ease-in-out;
}


.story-card {
  flex: 0 0 300px;
  height: 400px;
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.story-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px var(--glow);
}

.story-card-img {
  height: 200px;
  width: 100%;
  object-fit: cover;
  border-top-left-radius: var(--border-radius);
  border-top-right-radius: var(--border-radius);
}

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

.story-card-title {
  font-size: 1.4rem;
  margin-bottom: 10px;
}

.hero-prev,
  .hero-next,
  .carousel-arrow {
    display: none !important;
  }

.story-card-desc {
  font-size: 0.9rem;
  color: var(--text);
  opacity: 0.8;
  margin-bottom: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.story-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.story-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 15px;
}

.carousel-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 30px;
}

.carousel-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gradient);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 4px 10px var(--glow);
}

.carousel-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 15px var(--glow);
}


.trending-container {
  position: relative;
  overflow: hidden;
}

.trending-scroll {
  display: flex;
  gap: 20px;
  transition: transform 40s linear infinite;
  padding: 20px 0;
}

.trending-scroll:hover {
  animation-play-state: paused;
}


.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 25px;
  max-width: 1000px;
  margin: 0 auto;
}

.category-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  height: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.category-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: var(--gradient);
  opacity: 0;
  transform: rotate(45deg);
  transition: all 0.4s ease;
  z-index: 0;
}

.category-card:hover::before {
  opacity: 0.1;
  transform: rotate(45deg) translateY(-10%);
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px var(--glow);
}

.category-icon {
  font-size: 2rem;
  color: var(--primary);
  z-index: 1;
}

.category-name {
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 1;
}


.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.modal {
  background: var(--card-bg);
  width: 100%;
  max-width: 360px;
  border-radius: var(--border-radius);
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  transform: translateY(30px);
  opacity: 0;
  transition: transform 0.5s ease, opacity 0.5s ease;
}

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

.modal-header {
  padding: 20px;
  text-align: center;
  position: relative;
  border-bottom: 1px solid rgba(138, 43, 226, 0.1);
}

.modal-title {
  font-size: 1.5rem;
  margin: 0;
}

.modal-close {
  position: absolute;
  right: 20px;
  top: 20px;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text);
  opacity: 0.6;
  transition: var(--transition);
}

.modal-close:hover {
  opacity: 1;
  transform: rotate(90deg);
}

.modal-tabs {
  display: flex;
  border-bottom: 1px solid rgba(138, 43, 226, 0.1);
}

.modal-tab {
  flex: 1;
  padding: 15px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 2px solid transparent;
  font-weight: 600;
}

.modal-tab.active {
  border-bottom: 2px solid var(--primary);
  color: var(--primary);
}

.modal-body {
  padding: 30px;
}

.modal-form {
  display: none;
}

.modal-form.active {
  display: block;
}

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

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 0.9rem;
}

.form-input {
  width: 85%;
  padding: 12px 15px;
  border-radius: var(--border-radius);
  border: 1px solid rgba(138, 43, 226, 0.2);
  background: var(--bg);
  color: var(--text);
  font-family: 'Montserrat', sans-serif;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--glow);
}

.form-submit {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
}


footer {
  padding: 60px 0 30px;
  background: var(--card-bg);
  margin-top: 60px;
  border-top: 1px solid rgba(138, 43, 226, 0.1);
}

.footer-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-col h3 {
  margin-top: 0;
  font-size: 1.2rem;
  margin-bottom: 20px;
  position: relative;
  display: inline-block;
}

.footer-col h3::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--gradient);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  text-decoration: none;
  color: var(--text);
  opacity: 0.8;
  transition: var(--transition);
}

.footer-links a:hover {
  opacity: 1;
  color: var(--primary);
}

.footer-bottom {
  text-align: center;
  margin-top: 50px;
  padding-top: 20px;
  border-top: 1px solid rgba(138, 43, 226, 0.1);
  font-size: 0.9rem;
  opacity: 0.7;
}

.social-links {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.social-link {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(138, 43, 226, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text);
  transition: var(--transition);
}

.social-link:hover {
  background: var(--gradient);
  color: white;
  transform: translateY(-3px);
}


.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

.welcome-msg {
  font-weight: 600;
  display: none;
  align-items: center;
  gap: 8px;
}

.welcome-msg.active {
  display: flex;
  animation: slideDown 0.5s ease;
}

.no-results {
  text-align: center;
  padding: 30px;
  font-size: 1.2rem;
  display: none;
}


.logo-svg {
  width: 120px;
  height: 60px;
}

.star {
  opacity: 0.4;
  animation: twinkle 3s infinite both;
}

.star1 { animation-delay: 0.5s; }
.star2 { animation-delay: 1.0s; }
.star3 { animation-delay: 1.5s; }
.star4 { animation-delay: 0s; }
.star5 { animation-delay: 2s; }


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

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

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

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

@keyframes twinkle {
  0%, 100% { opacity: 0.3; r: 2; }
  50% { opacity: 1; r: 3; }
}


@media (max-width: 992px) {
  .hero-title {
    font-size: 3rem;
  }
  
  .story-card {
    flex: 0 0 280px;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  
  .hero {
    height: 70vh;
    min-height: 500px;
    top: 0;
  }
  
  .hero-story-title {
    font-size: 2.5rem;
  }
  
  .hero-story-desc {
    font-size: 1rem;
  }
  
  .story-card {
    flex: 0 0 260px;
  }

  .carousel-container {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .story-card {
    scroll-snap-align: start;
  }

  .carousel-buttons {
    display: none !important;
  }
  
  .search-input {
    width: 150px;
  }
  
  .search-input:focus {
    width: 200px;
  }
  
  .section-title {
    font-size: 1.8rem;
  }
  
  .btn {
    padding: 10px 20px;
    font-size: 14px;
  }
  
  .hero-prev,
  .hero-next,
  .carousel-arrow {
    display: none !important;
  }
}

@media (max-width: 576px) {
  .user-actions {
    gap: 8px;
  }
  
  .hero {
    height: 60vh;
    min-height: 400px;
    top: 0;
  }
  
  .hero-story-title {
    font-size: 2rem;
  }
  
  .hero-actions {
    flex-direction: column;
    gap: 12px;
  }
  
  .btn {
    width: 100%;
  }
  
  .story-card {
    flex: 0 0 230px;
    height: 460px;
  }
  
  .search-container {
    display: none;
  }
  
  .categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
  }
  
  .modal {
    max-width: 340px;
  }
  
  .hero-prev,
  .hero-next,
  .carousel-arrow {
    display: none !important;
  }
}


section {
  opacity: 1 !important;
  transform: translateY(0) !important;
}


.hero-nav {
  position: absolute;
  top: 92%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
}



.hero-nav:hover {
  background-color: rgba(0, 0, 0, 0.8);
}


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


.hero-background {
  background-image: url('https://images.unsplash.com/photo-1462331940025-496dfbfc7564?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1200&q=80');
}


.story-card-img {
  background-color: #f0f0f0;
}


.hero-background:empty {
  background-color: var(--card-bg);
}


.modal-overlay {
  z-index: 9999;
}


.trending-scroll {
  animation: scroll-left 40s linear infinite;
}

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


.read-btn, .add-btn {
  position: relative;
  z-index: 5;
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-height: 300px;
  overflow-y: auto;
  background-color: white;
  border: 1px solid #ddd;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.search-results.hidden {
  display: none;
}

.search-result-item {
  display: flex;
  align-items: center;
  padding: 8px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background-color 0.2s;
}

.search-result-item:hover {
  background-color: #f9f9f9;
}

.search-result-item img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  margin-right: 10px;
}

.search-result
-info h4 {
  font-size: 14px;
  margin: 0;
  font-weight: bold;
}

.search-result-info span {
  font-size: 12px;
  color: #777;
}

.search-results {
  background: var(--card-bg);
  color: var(--text);
  border-radius: var(--border-radius);
  padding: 10px 0;
}

.read-now-btn {
  background-color: #ffcc00;
  color: var(--text-dark); 
}
body.dark-theme .read-now-btn {
  color: #111;
}

.genre {
  background: rgba(138, 43, 226, 0.2);
  color: var(--primary);
}

body.dark-theme .genre {
  background: rgba(157, 78, 221, 0.2);
  color: #ffcc00;
}
body.dark-theme .modal-tab.active {
  color: var(--primary-light);
}

.account-dropdown {
  position: relative;
}

.account-btn {
  background: var(--gradient);
  color: white;
  padding: 8px 16px;
  border-radius: var(--border-radius);
  cursor: pointer;
}

.dropdown-menu {
  position: absolute;
  top: 120%;
  right: 0;
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: none;
  flex-direction: column;
  z-index: 100;
}

.account-dropdown:hover .dropdown-menu {
  display: flex;
}

.dropdown-menu a {
  padding: 10px 15px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.dropdown-menu a:hover {
  background: var(--gradient);
  color: white;
}

#toast-container {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
}

.toast {
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--primary);
  padding: 12px 20px;
  margin-top: 10px;
  border-radius: 8px;
  box-shadow: var(--shadow);
  animation: fadeSlideUp 0.3s ease, fadeOut 0.3s ease 3s forwards;
  font-weight: 500;
}

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

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

.account-wrapper {
  position: relative;
  display: inline-block;
}

.account-button {
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.3s;
}

.account-button:hover {
  background: rgba(255, 255, 255, 0.05);
}

.account-menu {
  position: absolute;
  top: 110%;
  right: 0;
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-width: 160px;
  z-index: 1000;
}

.account-menu.hidden {
  display: none;
}

.account-menu a {
  padding: 12px 16px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.2s;
}

.account-menu a:hover {
  background: var(--gradient);
  color: white;
}

.account-wrapper {
  position: relative;
  display: inline-block;
}

.account-button {
  background: transparent;
  border: 1px solid var(--border-color, #aaa);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  transition: all 0.25s ease;
  backdrop-filter: blur(6px);
}

.account-button:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.dropdown-arrow {
  font-size: 12px;
  transition: transform 0.3s ease;
}

.account-button.active .dropdown-arrow {
  transform: rotate(180deg);
}

.account-menu {
  position: absolute;
  top: 115%;
  right: 0;
  background: var(--card-bg, #fff);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  display: flex;
  flex-direction: column;
  min-width: 180px;
  overflow: hidden;
  z-index: 1000;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.account-menu.hidden {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.account-menu a {
  padding: 12px 16px;
  color: var(--text, #333);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  transition: background 0.25s ease;
}

.account-menu a:hover {
  background: var(--primary, #444);
  color: #fff;
}

.account-wrapper.hidden {
  display: none !important;
}

.story-card {
  position: relative;
  overflow: hidden; 
  border-radius: 8px;
  transition: all 0.4s ease;
  background: var(--card-bg, #fff);
}

.story-card-hover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transform: translateY(100%);
  transition: all 0.5s ease;
  z-index: 5;
  display: flex;
  flex-direction: column;
  box-sizing: border-box; 
  overflow: hidden;        
}

.story-card-overlay-content {
  width: 100%;
  padding: 20px 15px;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 60%, rgba(0,0,0,0) 100%);
  color: white;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.4s ease 0.1s;
  z-index: 6;
  box-sizing: border-box;
  overflow: hidden;
}

.story-card-overlay-desc {
  font-size: 0.9rem;
  margin-bottom: 12px;
  color: rgba(255,255,255,0.9);
  max-height: 60px;        
  overflow: hidden;
  text-overflow: ellipsis;
}

.read-now-btn {
  margin-top: auto;        
  align-self: flex-end;
}
