/* 
 * TunWalai Clone - Main Stylesheet
 * Thai boylove novel platform
 */

/* Global Styles */
:root {
  --primary-color: #ff6b6b;
  --secondary-color: #4ecdc4;
  --dark-color: #1a535c;
  --light-color: #f7fff7;
  --warning-color: #ffe66d;
  --danger-color: #ff6b6b;
  --success-color: #6bff8c;
  --gray-color: #6c757d;
  --light-gray-color: #f8f9fa;
}

body {
  font-family: "Noto Sans Thai", sans-serif;
  color: #333;
  line-height: 1.6;
  background-color: #f9f9f9;
}

a {
  color: var(--primary-color);
  transition: all 0.3s ease;
}

a:hover {
  color: var(--dark-color);
}

/* Header & Navigation */
.navbar-brand {
  font-weight: 600;
  color: var(--primary-color);
}

.navbar-brand img {
  border-radius: 8px;
}

.navbar {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-link {
  font-weight: 500;
}

.nav-link.active {
  color: var(--primary-color) !important;
}

/* Section Header Rows */
.d-flex.justify-content-between.align-items-center.mb-4 {
  background-color: var(--light-gray-color);
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
}

/* Hero Section - Featured Novels Carousel */
#featuredCarousel {
  margin: 2rem 0;
}

/* Section Headers with Gradient Backgrounds */
.section-header {
  padding: 1rem;
  border-radius: 0.5rem;
  color: white;
  margin-bottom: 1.5rem;
}

#latest-novels .section-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, #764ba2 100%);
}

#popular-novels .section-header {
  background: linear-gradient(135deg, #f54ea2 0%, var(--danger-color) 100%);
}

#categories .section-header {
  background: linear-gradient(135deg, var(--success-color) 0%, #38f9d7 100%);
}

.section-header + .btn {
  margin-top: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
}

.section-header + .btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

.carousel-inner {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.carousel-item img {
  height: 400px;
  width: 100%;
  object-fit: cover;
  object-position: center;
}

.carousel-caption {
  background: rgba(0, 0, 0, 0.6);
  border-radius: 5px;
  padding: 1.5rem;
  right: 5%;
  left: 5%;
  bottom: 20%;
  display: block !important;
}

.carousel-caption .btn {
  margin-top: 1rem;
  font-size: 1rem;
  padding: 0.5rem 1.5rem;
}

.carousel-caption h2 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.carousel-caption p {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.carousel-control-prev,
.carousel-control-next {
  width: 5%;
}

.carousel-indicators [data-bs-target] {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin: 0 5px;
  border: 1px solid #fff;
  background-color: transparent;
}

.carousel-indicators .active {
  background-color: #fff;
}

@media (max-width: 767.98px) {
  .carousel-item img {
    height: 300px;
  }

  .carousel-caption {
    bottom: 20%;
    padding: 1.5rem;
    right: 10%;
    left: 10%;
  }

  .carousel-caption h2 {
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
  }

  .carousel-caption p {
    font-size: 1.1rem;
    margin-bottom: 1.25rem;
  }
}

@media (max-width: 575.98px) {
  .carousel-item img {
    height: 250px;
  }

  .carousel-caption {
    bottom: 15%;
    padding: 1rem;
    right: 5%;
    left: 5%;
  }

  .carousel-caption h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
  }

  .carousel-caption p {
    font-size: 1rem;
    margin-bottom: 1rem;
  }
}

/* Novel Cards */
.novel-card {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
  background-color: #fff;
}

.novel-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.novel-card .card-img-top {
  aspect-ratio: 1/1;
  width: 100%;
  object-fit: cover;
}

.novel-card .card-body {
  padding: 1.25rem;
}

.card-body.text-center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.novel-card .card-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
  height: 2.5rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--primary-color);
}

.novel-card .card-text,
.novel-card .novel-description {
  color: var(--gray-color);
  font-size: 0.9rem;
  height: 3rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
  margin-bottom: 0.75rem;
}

.novel-card .card-footer {
  background-color: #fff;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding: 0.75rem 1.25rem;
}

.novel-card .author {
  font-size: 0.85rem;
  color: var(--gray-color);
}

.novel-card .stats {
  font-size: 0.85rem;
  color: var(--gray-color);
}

.novel-card .premium-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: var(--warning-color);
  color: #333;
  padding: 0.25rem 0.5rem;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Clickable Card Styles */
a.novel-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

a.novel-card-link:hover .novel-card {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

a.novel-card-link:hover .card-title {
  color: var(--dark-color);
}

/* 6-column Layout Adjustments */
@media (min-width: 992px) {
  .row-cols-lg-6 > * {
    flex: 0 0 auto;
    width: 16.6666666667%;
  }
}

/* Category & Tag Pills */
.category-pill,
.tag-pill {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  font-size: 0.85rem;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
}

.category-pill {
  background-color: var(--light-color);
  color: var(--dark-color);
  border: 1px solid var(--dark-color);
}

.category-pill:hover {
  background-color: var(--dark-color);
  color: var(--light-color);
}

.tag-pill {
  background-color: #f0f0f0;
  color: var(--gray-color);
}

.tag-pill:hover {
  background-color: var(--gray-color);
  color: #fff;
}

/* Novel Detail Page */
.novel-detail-cover {
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  max-height: 400px;
  object-fit: cover;
}

/* Rating System */
.rating-stars {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stars-container {
  display: flex;
  gap: 5px;
}

.rating-stars .star {
  font-size: 1.5rem;
  color: #ddd;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rating-stars .star.hover,
.rating-stars .star.active {
  color: #ffc107;
}

.rating-stars .star.hover {
  transform: scale(1.2);
}

.clear-rating {
  color: #666;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.clear-rating:hover {
  color: #dc3545;
  text-decoration: underline;
}

.novel-detail-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.novel-detail-author {
  font-size: 1rem;
  color: var(--gray-color);
  margin-bottom: 1rem;
}

.novel-detail-stats {
  margin-bottom: 1.5rem;
}

.novel-detail-stats span {
  margin-right: 1rem;
  color: var(--gray-color);
}

.novel-detail-description {
  margin-bottom: 2rem;
  line-height: 1.8;
}

.chapter-list {
  list-style: none;
  padding: 0;
}

.chapter-item {
  padding: 1rem;
  border-bottom: 1px solid #eee;
  transition: background-color 0.3s ease;
}

.chapter-item:hover {
  background-color: #f8f9fa;
}

.chapter-item .premium-badge {
  background-color: var(--warning-color);
  color: #333;
  padding: 0.25rem 0.5rem;
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 0.5rem;
}

.chapter-item .chapter-date {
  font-size: 0.85rem;
  color: var(--gray-color);
}

/* Chapter Reading Page */
.chapter-content {
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 2rem;
}

.chapter-navigation {
  display: flex;
  justify-content: space-between;
  margin: 2rem 0;
}

/* Author CTA Section */
.author-cta {
  background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 50%, #ff6b6b 100%);
  box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
  border-radius: 10px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.author-cta::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.1) 0%,
    rgba(255, 255, 255, 0) 100%
  );
  z-index: 1;
}

.author-cta .row {
  position: relative;
  z-index: 2;
}

.author-cta h3 {
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.author-cta p {
  opacity: 0.9;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.author-cta .btn-light {
  font-weight: 600;
  border: none;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.author-cta .btn-light:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  background-color: #fff;
}

/* Forms */
.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(255, 107, 107, 0.25);
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #ff5252;
  border-color: #ff5252;
}

.btn-outline-primary {
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-outline-primary:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

/* Author Dashboard */
.dashboard-card {
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  height: 100%;
}

.dashboard-card:hover {
  transform: translateY(-5px);
}

.dashboard-card .card-body {
  padding: 1.5rem;
}

.dashboard-card .card-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.dashboard-card .card-text {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
}

/* Credit System */
.credit-package {
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  height: 100%;
  border: 2px solid transparent;
}

.credit-package:hover {
  transform: translateY(-5px);
  border-color: var(--primary-color);
}

.credit-package .card-body {
  padding: 1.5rem;
}

.credit-package .credit-amount {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
}

.credit-package .credit-price {
  font-size: 1.5rem;
  font-weight: 600;
}

.credit-package .credit-bonus {
  color: var(--success-color);
  font-weight: 600;
}

/* Footer */
footer {
  border-top: 1px solid #eee;
}

footer h5 {
  font-weight: 600;
  margin-bottom: 1rem;
}

footer a {
  color: #333;
}

footer a:hover {
  color: var(--primary-color);
}

/* Responsive Adjustments */
@media (max-width: 767.98px) {
  .novel-card .card-img-top {
    aspect-ratio: 1/1;
    width: 100%;
    height: auto;
    object-fit: cover;
  }

  /* Filter Section Styles */
  @media (max-width: 767.98px) {
    .filter-section {
      max-width: 100%;
      background: white;
      border-radius: 10px;
      box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
      padding: 1rem;
      z-index: 999;
    }
  }

  .filter-toggle.collapsed {
    transform: rotate(0deg);
  }

  .filter-toggle.expanded {
    transform: rotate(180deg);
  }

  .filter-toggle:hover {
    background-color: var(--dark-color);
    transform: scale(1.1);
  }

  .filter-content {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 90%;
    max-width: 300px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    padding: 1rem;
    transform: scale(0);
    transform-origin: bottom right;
    transition: transform 0.3s ease;
    z-index: 999;
  }

  .filter-content.expanded {
    transform: scale(1);
  }

  .filter-content.collapsed {
    transform: scale(0);
  }

  .novel-detail-cover {
    max-height: 100%;
  }

  .novel-detail-title {
    font-size: 1.5rem;
  }

  .chapter-content {
    font-size: 1rem;
  }
}

@media (max-width: 575.98px) {
  .novel-card .card-img-top {
    width: 100%;
  }

  .novel-detail-cover {
    max-height: 100%;
  }

  .novel-detail-title {
    font-size: 1.3rem;
  }
}
