/* Digital Splendor - Literary Luxury Website */

/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Lora:ital,wght@0,400;0,500;0,600;1,400;1,500&display=swap');

/* CSS Variables - Brand Colors */
:root {
  --navy: #0B1428;
  --teal: #4DD8F0;
  --gold: #F5C842;
  --white: #FFFFFF;
  --light-gray: #F8F9FA;
  --medium-gray: #6C757D;
  --dark-gray: #343A40;
  
  /* Color variations */
  --navy-light: #1a2435;
  --navy-dark: #05090f;
  --gold-light: #f7d970;
  --gold-dark: #e6b625;
  --teal-light: #7de3f5;
  --teal-dark: #2bc5e0;
  
  /* Typography */
  --font-display: 'Playfair Display', serif;
  --font-body: 'Lora', serif;
  
  /* Spacing */
  --container-max-width: 1200px;
  --section-padding: 4rem 0;
  --card-border-radius: 12px;
  
  /* Effects */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 15px 35px rgba(0, 0, 0, 0.1), 0 5px 15px rgba(0, 0, 0, 0.07);
  --gold-glow: 0 0 20px rgba(245, 200, 66, 0.3);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  background: var(--navy);
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Enhanced Background atmosphere */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    var(--mouse-gradient, radial-gradient(circle at 50% 50%, rgba(245, 200, 66, 0.02) 0%, transparent 50%)),
    radial-gradient(circle at 25% 25%, rgba(245, 200, 66, 0.02) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(77, 216, 240, 0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
  transition: background 0.3s ease;
}

/* Grain texture overlay */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAwIiBoZWlnaHQ9IjMwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8ZmlsdGVyIGlkPSJub2lzZUZpbHRlciI+CiAgICA8ZmVUdXJidWxlbmNlIGJhc2VGcmVxdWVuY3k9IjAuOSIgbnVtT2N0YXZlcz0iNCIgc3RpdGNoVGlsZXM9InN0aXRjaCIvPgogIDwvZmlsdGVyPgogIDxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbHRlcj0idXJsKCNub2lzZUZpbHRlcikiIGZpbGw9InRyYW5zcGFyZW50IiBvcGFjaXR5PSIwLjAyIi8+Cjwvc3ZnPg==');
  opacity: 0.015;
  pointer-events: none;
  z-index: -1;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold) 0%, var(--teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  position: relative;
}

/* Shimmer animation for hero title */
.hero-title {
  position: relative;
  overflow: hidden;
}

.hero-title::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

h2 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  color: var(--white);
}

h3 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--teal);
}

h4 {
  font-size: clamp(1.2rem, 2.5vw, 1.5rem);
  color: var(--white);
}

p {
  margin-bottom: 1.2rem;
  color: rgba(255, 255, 255, 0.9);
}

a {
  color: var(--teal);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--teal-light);
  text-shadow: var(--gold-glow);
}

/* Container and Layout */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: var(--section-padding);
}

/* Header and Navigation */
.header {
  background: rgba(11, 20, 40, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(77, 216, 240, 0.2);
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  transition: var(--transition);
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  height: 50px;
  width: auto;
  transition: var(--transition);
}

.logo:hover {
  filter: drop-shadow(var(--gold-glow));
  transform: scale(1.05);
}

/* Hero section logo */
.hero-logo {
  height: 80px;
  width: auto;
  margin-bottom: 2rem;
  filter: drop-shadow(0 0 20px rgba(245, 200, 66, 0.5));
  animation: logoPulse 4s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { 
    filter: drop-shadow(0 0 20px rgba(245, 200, 66, 0.5));
    transform: scale(1);
  }
  50% { 
    filter: drop-shadow(0 0 30px rgba(245, 200, 66, 0.8));
    transform: scale(1.02);
  }
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  color: var(--white);
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: var(--transition);
}

.nav-link:hover {
  background: rgba(245, 200, 66, 0.1);
  color: var(--gold);
  text-shadow: none;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  background: 
    linear-gradient(135deg, rgba(11, 20, 40, 0.8) 0%, rgba(26, 36, 53, 0.8) 100%),
    url('../images/branding/digital_splendor_banner_crop.png') center/cover;
  margin-top: -80px;
  padding-top: 80px;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, transparent 0%, rgba(11, 20, 40, 0.4) 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero-title {
  font-size: clamp(3rem, 6vw, 5rem);
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem;
}

.hero-subtitle {
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  color: var(--teal);
  font-style: italic;
  margin-bottom: 2rem;
}

.hero-description {
  font-size: 1.2rem;
  margin-bottom: 3rem;
  color: rgba(255, 255, 255, 0.9);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  border-radius: var(--card-border-radius);
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  font-size: 1rem;
  font-family: var(--font-body);
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: var(--navy);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--gold-glow);
  color: var(--navy);
}

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

.btn-secondary:hover {
  background: var(--teal);
  color: var(--navy);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Card Components */
.card {
  background: rgba(26, 36, 53, 0.6);
  border-radius: var(--card-border-radius);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  border: 1px solid rgba(77, 216, 240, 0.1);
  backdrop-filter: blur(10px);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(77, 216, 240, 0.3);
}

.book-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.book-card-image {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: var(--card-border-radius);
  transition: var(--transition);
}

.book-card:hover .book-card-image {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.book-card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(11, 20, 40, 0.95));
  padding: 2rem 1.5rem 1.5rem;
  border-radius: 0 0 var(--card-border-radius) var(--card-border-radius);
}

.book-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.book-author {
  color: var(--teal);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.book-category {
  display: inline-block;
  background: rgba(245, 200, 66, 0.2);
  color: var(--gold);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* Grid Layout */
.grid {
  display: grid;
  gap: 2rem;
}

.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Library Grid */
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 3rem 0;
}

.filter-btn {
  padding: 0.8rem 1.5rem;
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 25px;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-body);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--teal);
  color: var(--navy);
  border-color: var(--teal);
  transform: translateY(-2px);
}

/* Page Header */
.page-header {
  text-align: center;
  padding: 8rem 0 4rem;
  background: 
    linear-gradient(135deg, rgba(11, 20, 40, 0.9) 0%, rgba(26, 36, 53, 0.9) 100%),
    radial-gradient(circle at center, rgba(245, 200, 66, 0.1) 0%, transparent 70%);
}

.page-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: 1rem;
}

.page-subtitle {
  font-size: 1.3rem;
  color: var(--teal);
  font-style: italic;
  max-width: 600px;
  margin: 0 auto;
}

/* Footer */
.footer {
  background: var(--navy-dark);
  border-top: 1px solid rgba(77, 216, 240, 0.2);
  padding: 3rem 0 1rem;
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  color: var(--gold);
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

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

.footer-links a:hover {
  color: var(--teal);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
}

/* Video Embed */
.video-container {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  margin: 2rem 0;
  border-radius: var(--card-border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Content Sections */
.content-section {
  margin: 3rem 0;
}

.content-section h3 {
  border-bottom: 2px solid var(--gold);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

.content-section p {
  font-size: 1.1rem;
  line-height: 1.8;
}

/* Share Buttons */
.share-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 2rem 0;
}

.share-btn {
  padding: 0.8rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.share-btn:hover {
  background: var(--teal);
  color: var(--navy);
  transform: translateY(-3px);
}

/* Mobile Menu */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Responsive Design */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--navy);
    flex-direction: column;
    padding: 1rem;
    border-top: 1px solid rgba(77, 216, 240, 0.2);
  }
  
  .nav-links.active {
    display: flex;
  }
  
  .mobile-menu-toggle {
    display: block;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .btn-group {
    flex-direction: column;
    align-items: center;
  }
  
  .library-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
  }
  
  .filter-bar {
    flex-direction: column;
    align-items: center;
  }
  
  .container {
    padding: 0 1rem;
  }
  
  .section {
    padding: 2rem 0;
  }
}

@media (max-width: 480px) {
  .hero {
    text-align: center;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .library-grid {
    grid-template-columns: 1fr;
  }
  
  .card {
    padding: 1.5rem;
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.8s ease-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--navy);
}

::-webkit-scrollbar-thumb {
  background: var(--teal);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--teal-dark);
}

/* ===== ENHANCED VISUAL EFFECTS ===== */

/* Loading Animation */
#page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--navy);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  transition: opacity 0.5s ease;
}

.loader-content {
  text-align: center;
}

.book-animation {
  position: relative;
  width: 80px;
  height: 100px;
  margin: 0 auto 2rem;
}

.book-spine {
  width: 8px;
  height: 100px;
  background: var(--gold);
  position: absolute;
  left: 0;
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(245, 200, 66, 0.5);
}

.pages {
  position: absolute;
  right: 0;
  top: 0;
  width: 65px;
  height: 100px;
  perspective: 300px;
}

.page {
  position: absolute;
  width: 65px;
  height: 100px;
  background: #f8f9fa;
  transform-origin: left center;
  border-radius: 0 3px 3px 0;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
}

.page:nth-child(1) {
  animation: flipPage 2s ease-in-out infinite;
  z-index: 3;
}

.page:nth-child(2) {
  animation: flipPage 2s ease-in-out infinite 0.3s;
  z-index: 2;
}

.page:nth-child(3) {
  animation: flipPage 2s ease-in-out infinite 0.6s;
  z-index: 1;
}

@keyframes flipPage {
  0%, 20% { transform: rotateY(0deg); }
  50%, 70% { transform: rotateY(-180deg); }
  100% { transform: rotateY(0deg); }
}

.loader-text {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--gold);
  font-weight: 600;
  opacity: 0;
  animation: fadeInText 0.5s ease-in forwards 0.5s;
}

@keyframes fadeInText {
  to { opacity: 1; }
}

/* Enhanced Card Styles */
.card, .book-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
  overflow: hidden;
  position: relative;
}

.card::before, .book-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent, rgba(245, 200, 66, 0.05), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.card:hover::before, .book-card:hover::before {
  opacity: 1;
}

.book-card-image {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

/* Scroll Animations */
.animate-in {
  opacity: 0;
  transform: translateY(30px);
  animation: slideInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.scale-in {
  opacity: 0;
  transform: scale(0.9);
  animation: scaleIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes scaleIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Decorative Section Separators */
.section-separator {
  position: relative;
  text-align: center;
  margin: 4rem 0;
}

.section-separator::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  z-index: 1;
}

.section-separator::after {
  content: '❦';
  display: inline-block;
  background: var(--navy);
  color: var(--gold);
  padding: 0 2rem;
  font-size: 1.5rem;
  position: relative;
  z-index: 2;
}

/* Enhanced Typography */
.hero-subtitle {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--teal);
  margin-bottom: 1.5rem;
  opacity: 0.9;
}

/* Footer Logo */
.footer-logo {
  height: 40px;
  width: auto;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 10px rgba(245, 200, 66, 0.3));
}

/* Enhanced Button Hover Effects */
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(245, 200, 66, 0.3);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  /* Disable particle effects and 3D transforms on mobile */
  #particles-canvas {
    display: none !important;
  }
  
  .card, .book-card {
    transform: none !important;
  }
  
  .hero-logo {
    height: 60px;
  }
  
  /* Simplify animations on mobile */
  .animate-in, .fade-in-up, .scale-in {
    animation-duration: 0.3s;
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  #particles-canvas {
    display: none !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .hero-title::before {
    display: none;
  }
  
  h1 {
    background: none;
    color: var(--gold);
    -webkit-text-fill-color: var(--gold);
  }
}