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

:root {
  --primary-color: #0F172A; /* Deep slate */
  --accent-color: #D4AF37; /* Gold */
  --accent-hover: #F1C40F;
  --bg-color: #F8FAFC;
  --surface-color: #FFFFFF;
  --text-main: #1E293B;
  --text-muted: #64748B;
  --border-color: #E2E8F0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-glow: 0 0 20px rgba(212, 175, 55, 0.3);
  --radius-md: 12px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  color: var(--primary-color);
  line-height: 1.2;
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header & Nav */
header {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: var(--shadow-sm);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.5rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  color: var(--primary-color);
}

.logo img {
  height: 40px;
  object-fit: contain;
}

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

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

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

.nav-links a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: var(--accent-color);
  transition: var(--transition);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: var(--radius-full);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background-color: #1e293b;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-accent {
  background-color: var(--accent-color);
  color: var(--primary-color);
  box-shadow: var(--shadow-glow);
}

.btn-accent:hover {
  background-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.5);
}

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

.btn-outline:hover {
  background-color: var(--primary-color);
  color: white;
}

/* Hero Section */
.hero {
  padding: 160px 0 100px;
  background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 800px;
  height: 800px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,175,55,0.1) 0%, rgba(255,255,255,0) 70%);
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 650px;
}

.hero h1 {
  font-size: 4rem;
  margin-bottom: 24px;
  letter-spacing: -1px;
}

.hero h1 span {
  color: var(--accent-color);
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 40px;
  max-width: 500px;
}

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

/* Section Titles */
.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header h2 {
  font-size: 2.5rem;
  margin-bottom: 16px;
}

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

/* Book Catalog */
.catalog {
  padding: 100px 0;
  background-color: var(--surface-color);
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 32px;
}

.book-card {
  background: var(--surface-color);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--border-color);
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
}

.book-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent-color);
}

.book-cover {
  width: 100%;
  height: 350px;
  border-radius: 8px;
  background: linear-gradient(145deg, #e2e8f0, #cbd5e1);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-family: 'Outfit';
  font-weight: 600;
  font-size: 1.2rem;
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.05);
  overflow: hidden;
  position: relative;
}

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

.book-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

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

.book-title {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.book-author {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.book-price {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 20px;
}

.book-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.book-actions button {
  flex: 1;
  padding: 10px;
  font-size: 0.9rem;
}

/* Pricing Section */
.pricing {
  padding: 100px 0;
  background: var(--bg-color);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  align-items: center;
}

.pricing-card {
  background: var(--surface-color);
  border-radius: var(--radius-lg);
  padding: 40px 30px;
  border: 1px solid var(--border-color);
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pricing-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

.pricing-card.popular {
  border: 2px solid var(--accent-color);
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
}

.pricing-card.popular:hover {
  transform: scale(1.05) translateY(-10px);
}

.popular-badge {
  position: absolute;
  top: 16px;
  right: -32px;
  background: var(--accent-color);
  color: var(--primary-color);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 6px 40px;
  transform: rotate(45deg);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.plan-name {
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.plan-price {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 8px;
  font-family: 'Outfit';
}

.plan-price span {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 400;
}

.plan-features {
  margin: 32px 0;
  text-align: left;
  flex-grow: 1;
}

.plan-features li {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
}

.plan-features li svg {
  color: var(--accent-color);
  width: 20px;
  height: 20px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

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

.modal-content {
  background: var(--surface-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  padding: 40px;
  position: relative;
  transform: translateY(20px) scale(0.95);
  transition: var(--transition);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-height: 90vh;
  overflow-y: auto;
}

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

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

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

/* Payment Form */
.form-group {
  margin-bottom: 24px;
}

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

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  transition: var(--transition);
  background: var(--bg-color);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
  background: var(--surface-color);
}

.payment-methods {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.payment-method {
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 8px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.payment-method.active {
  border-color: var(--primary-color);
  background: rgba(15, 23, 42, 0.05);
}

.payment-method svg, .payment-method img {
  height: 30px;
  width: auto;
  object-fit: contain;
}

.payment-method span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-color);
}

.payment-details {
  display: none;
}
.payment-details.active {
  display: block;
  animation: fadeIn 0.3s;
}

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

/* Footer */
footer {
  background: var(--primary-color);
  color: white;
  padding: 80px 0 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 60px;
  margin-bottom: 60px;
}

.footer-brand h3 {
  color: white;
  font-size: 2rem;
  margin-bottom: 16px;
}

.footer-brand p {
  color: rgba(255, 255, 255, 0.7);
  max-width: 300px;
}

.footer-links h4 {
  color: white;
  margin-bottom: 24px;
  font-size: 1.125rem;
}

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

.footer-links ul li a {
  color: rgba(255, 255, 255, 0.7);
  transition: var(--transition);
}

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

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 32px;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
}

/* Reader Interface */
.reader-body {
  background-color: #f4f1ea; /* Sepia-like reading background */
  color: #333;
  overflow-x: hidden;
  user-select: none; /* Prevent selection */
  -webkit-user-select: none;
}

.reader-header {
  background: var(--surface-color);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border-color);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 10;
}

.reader-content {
  max-width: 800px;
  margin: 100px auto 60px;
  padding: 40px 60px;
  background: white;
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-md);
  font-size: 1.25rem;
  line-height: 1.8;
  font-family: 'Inter', serif;
}

/* Protection Overlay */
.protection-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0F172A;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s;
}

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

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  padding: 8px;
}

/* Responsive */
@media (max-width: 992px) {
  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }
  .pricing-card.popular {
    transform: none;
  }
  .pricing-card.popular:hover {
    transform: translateY(-10px);
  }
  .hero h1 {
    font-size: 3rem;
  }
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }
  
  .nav-links {
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    background: var(--surface-color);
    flex-direction: column;
    padding: 24px;
    gap: 16px;
    box-shadow: var(--shadow-md);
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    transition: clip-path 0.3s ease-in-out;
  }

  .nav-links.active {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
  }
  
  .nav-links .btn {
    width: 100%;
  }

  .hero {
    padding: 120px 0 60px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .reader-content {
    padding: 20px;
    margin: 80px 16px 40px;
  }
  
  /* Reader Controls adjustment for small screens */
  .reader-header {
      padding: 0 16px;
  }
  #zoom_val {
      display: none; /* hide zoom text on very small screens to save space */
  }
}
