/* ===== Google Font Import ===== */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&family=Playfair+Display:wght@400;700&display=swap');

/* ===== CSS Custom Properties ===== */
:root {
  --color-bg: #0d0d0d;
  --color-bg-alt: #1a1a1a;
  --color-surface: #222;
  --color-text: #e0e0e0;
  --color-text-muted: #999;
  --color-accent: #c0392b;
  --color-accent-hover: #e74c3c;
  --color-star: #f1c40f;
  --color-star-outline: #f1c40f;
  --color-white: #fff;
  --font-body: 'Roboto', sans-serif;
  --font-display: 'Playfair Display', serif;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

/* ===== Banner ===== */
.site-banner {
  width: 100%;
  overflow: hidden;
  background-color: var(--color-bg);
}

.site-banner img {
  width: 100%;
  height: auto;
  display: block;
}

/* ===== Navbar ===== */
.navbar {
  background-color: var(--color-bg-alt) !important;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #333;
}

.navbar-brand {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--color-white) !important;
  letter-spacing: 0.5px;
}

.navbar-nav .nav-link {
  color: var(--color-text-muted) !important;
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: var(--color-white) !important;
}

.navbar-toggler {
  border-color: rgba(255,255,255,0.2);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255,255,255,0.7%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  padding: 2rem 0 1rem;
}

/* ===== Home Page ===== */
.home-book-section {
  display: flex;
  align-items: center;
  gap: 3rem;
}

.home-book-image {
  flex: 0 0 auto;
  max-width: 320px;
}

.home-book-image img {
  width: 100%;
  border-radius: 4px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.home-book-image img:hover {
  transform: scale(1.03);
  box-shadow: 0 12px 40px rgba(0,0,0,0.7);
}

.home-book-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.home-book-info .book-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.home-book-info .tagline {
  color: var(--color-text-muted);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

/* ===== Stars ===== */
.stars {
  display: flex;
  gap: 4px;
  margin-bottom: 1rem;
  justify-content: center;
  align-items: center;
}

.stars .star-filled {
  color: var(--color-star);
  font-size: 1.25rem;
  line-height: 1;
}

.stars .star-outline {
  color: var(--color-star-outline);
  font-size: 1.25rem;
  line-height: 1;
  -webkit-text-stroke: 1px var(--color-star-outline);
}

.stars .star-partial {
  display: block;
}

/* ===== Buttons ===== */
.btn-buy-now {
  background-color: var(--color-accent);
  color: var(--color-white);
  border: none;
  padding: 0.75rem 2.5rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 4px;
  transition: background-color 0.3s ease, transform 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-buy-now:hover {
  background-color: var(--color-accent-hover);
  color: var(--color-white);
  transform: translateY(-2px);
}

.btn-contact {
  background-color: var(--color-accent);
  color: var(--color-white);
  border: none;
  padding: 0.75rem 2.5rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 4px;
  transition: background-color 0.3s ease, transform 0.2s ease;
  letter-spacing: 0.5px;
}

.btn-contact:hover {
  background-color: var(--color-accent-hover);
  color: var(--color-white);
  transform: translateY(-2px);
}

/* ===== Book Page ===== */
.book-detail-section {
  display: flex;
  align-items: flex-start;
  gap: 3rem;
}

.book-detail-image {
  flex: 0 0 auto;
  max-width: 320px;
}

.book-detail-image img {
  width: 100%;
  border-radius: 4px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

.book-detail-info {
  flex: 1;
}

.book-detail-info .book-title {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 0.5rem;
  line-height: 1.2;
  text-align: center;
}

.book-detail-info .book-tagline {
  font-style: italic;
  font-weight: 700;
  color: var(--color-text-muted);
  font-size: 1.35rem;
  margin-bottom: 1rem;
  text-align: center;
}

.book-detail-info .book-description p {
  margin-bottom: 1rem;
  color: var(--color-text);
}

/* Buy dropdown */
.buy-dropdown .btn {
  background-color: var(--color-accent);
  color: var(--color-white);
  border: none;
  padding: 0.6rem 1.5rem;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: background-color 0.3s ease;
}

.buy-dropdown .btn:hover,
.buy-dropdown .btn:focus {
  background-color: var(--color-accent-hover);
  color: var(--color-white);
}

.buy-dropdown .dropdown-toggle-split {
  border-left: 1px solid rgba(255,255,255,0.3);
}

.buy-dropdown .dropdown-menu {
  background-color: var(--color-bg-alt);
  border: 1px solid #333;
  border-radius: 4px;
  padding: 0.5rem 0;
}

.buy-dropdown .dropdown-item {
  color: var(--color-text);
  padding: 0.5rem 1.25rem;
  font-size: 0.95rem;
  transition: background-color 0.2s ease;
}

.buy-dropdown .dropdown-item:hover {
  background-color: var(--color-surface);
  color: var(--color-white);
}

/* ===== Reviews ===== */
.reviews-section {
  margin-top: 3rem;
  border-top: 1px solid #333;
  padding-top: 2rem;
}

.review {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #2a2a2a;
}

.review:last-child {
  border-bottom: none;
}

.review .stars {
  justify-content: flex-start;
}

.review p {
  color: var(--color-text);
  margin-bottom: 0.75rem;
}

/* ===== Author Page ===== */
.author-heading {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--color-white);
  text-align: center;
  margin-bottom: 2.5rem;
}

.author-section {
  max-width: 900px;
}

.author-layout {
  display: flex;
  align-items: flex-start;
  gap: 2.5rem;
}

.author-photo {
  flex: 0 0 auto;
  max-width: 280px;
}

.author-photo img {
  width: 100%;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

.author-text {
  flex: 1;
}

.author-section p {
  margin-bottom: 1.25rem;
  color: var(--color-text);
}

/* ===== Contact Page ===== */
.contact-heading {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--color-white);
  text-align: center;
  margin-bottom: 2.5rem;
}

.contact-links {
  list-style: none;
  padding: 0;
  margin: 0 auto;
  max-width: 500px;
  text-align: center;
}

.contact-links li {
  margin-bottom: 1.25rem;
  font-size: 1rem;
}

.contact-links li a {
  color: var(--color-text);
  transition: color 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.contact-links li a:hover {
  color: var(--color-accent-hover);
}

.contact-links .contact-label {
  color: var(--color-text-muted);
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.email-protect {
  unicode-bidi: bidi-override;
  direction: rtl;
  user-select: none;
}

/* ===== Footer ===== */
.site-footer {
  background-color: var(--color-bg-alt);
  border-top: 1px solid #333;
  padding: 2rem 0 1rem;
  margin-top: 1.5rem;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.footer-social {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.footer-social a {
  color: var(--color-text-muted);
  font-size: 1.25rem;
  transition: color 0.3s ease;
}

.footer-social a:hover {
  color: var(--color-white);
}

.footer-nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-nav a {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.footer-nav a:hover {
  color: var(--color-white);
}

.footer-bottom {
  border-top: 1px solid #333;
  padding-top: 1rem;
}

.footer-bottom p {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin: 0;
}

/* ===== Responsive ===== */
@media (max-width: 767.98px) {
  .home-book-section {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .home-book-image {
    max-width: 240px;
  }

  .home-book-info .book-title {
    font-size: 1.75rem;
  }

  .book-detail-section {
    flex-direction: column;
    align-items: center;
  }

  .book-detail-image {
    max-width: 240px;
  }

  .book-detail-info .book-title {
    font-size: 1.5rem;
    text-align: center;
  }

  .book-detail-info .book-tagline {
    text-align: center;
  }

  .book-detail-info .stars {
    justify-content: center;
  }

  .footer-top {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .author-layout {
    flex-direction: column;
    align-items: center;
  }

  .author-photo {
    max-width: 220px;
  }

  .footer-nav {
    justify-content: center;
  }

  .footer-bottom {
    text-align: center;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) {
  .home-book-image {
    max-width: 260px;
  }

  .book-detail-image {
    max-width: 260px;
  }
}
