/* Readio Custom Styles */

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

body {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.font-poppins {
  font-family: 'Poppins', sans-serif;
}

.font-merriweather {
  font-family: 'Merriweather', serif;
}

/* Custom scrollbar with warm colors */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #F5EFE7;
}

::-webkit-scrollbar-thumb {
  background: #8B6F47;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #5D4E37;
}

/* Smooth transitions */
button, a, .nav-link, .feature-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading spinner */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Book card hover effects */
.book-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  transition: all 0.3s ease;
}

.book-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(139, 111, 71, 0.2);
}

.book-card img {
  transition: transform 0.3s ease;
}

.book-card:hover img {
  transform: scale(1.05);
}

/* Modal overlay animation */
.modal-overlay {
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Form inputs styling */
input:focus, textarea:focus {
  outline: none;
}

input, textarea {
  font-family: 'Poppins', sans-serif;
}

/* Custom badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, #8B6F47 0%, #D4AF37 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Progress bar animation */
.progress-bar {
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(90deg, #8B6F47 0%, #D4AF37 100%);
}

/* Activity feed styles */
.activity-item {
  border-left: 4px solid #8B6F47;
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
  transition: all 0.3s ease;
}

.activity-item:hover {
  border-left-color: #D4AF37;
  transform: translateX(4px);
}

/* Leaderboard position badges */
.position-gold {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: #8B4513;
}

.position-silver {
  background: linear-gradient(135deg, #C0C0C0 0%, #A8A8A8 100%);
  color: #4A4A4A;
}

.position-bronze {
  background: linear-gradient(135deg, #CD7F32 0%, #B8733C 100%);
  color: #4A2F1C;
}

/* Feature card enhancements */
.feature-card {
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #8B6F47 0%, #D4AF37 100%);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.feature-card:hover::before {
  transform: scaleX(1);
}

/* Stats cards */
.stat-card {
  background: linear-gradient(135deg, #F5EFE7 0%, #E8DCC4 100%);
  border: 2px solid #D5B895;
  border-radius: 20px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(139, 111, 71, 0.15);
  border-color: #8B6F47;
}

/* Book cover placeholder */
.book-cover-placeholder {
  background: linear-gradient(135deg, #8B6F47 0%, #5D4E37 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
}

/* Reading progress indicators */
.reading-progress {
  position: relative;
  background: #E8DCC4;
  border-radius: 999px;
  overflow: hidden;
  height: 8px;
}

.reading-progress-bar {
  background: linear-gradient(90deg, #8B6F47 0%, #D4AF37 100%);
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Gem and points animations */
@keyframes gemShine {
  0%, 100% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.1);
    filter: brightness(1.2);
  }
}

.gem-icon:hover {
  animation: gemShine 0.6s ease-in-out;
}

/* Challenge card styles */
.challenge-card {
  background: linear-gradient(135deg, #8B6F47 0%, #5D4E37 100%);
  border-radius: 24px;
  padding: 2rem;
  color: white;
  position: relative;
  overflow: hidden;
}

.challenge-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.2) 0%, transparent 70%);
  animation: rotate 20s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Toast notification styles */
.toast {
  background: white;
  border-left: 4px solid #8B6F47;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Button ripple effect */
.button-ripple {
  position: relative;
  overflow: hidden;
}

.button-ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.button-ripple:active::after {
  width: 300px;
  height: 300px;
}

/* Responsive utilities */
@media (max-width: 768px) {
  .nav-link {
    display: block;
    padding: 0.75rem 0;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .feature-card {
    margin-bottom: 1.5rem;
  }
}

/* Print styles */
@media print {
  nav, button, footer {
    display: none;
  }
  
  body {
    background: white;
  }
}

/* Accessibility enhancements */
.focus-visible:focus {
  outline: 3px solid #D4AF37;
  outline-offset: 2px;
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, #E8DCC4 25%, #F5EFE7 50%, #E8DCC4 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Decorative elements */
.book-decoration {
  position: relative;
}

.book-decoration::before {
  content: '📖';
  position: absolute;
  font-size: 6rem;
  opacity: 0.05;
  top: -2rem;
  right: -2rem;
  transform: rotate(-15deg);
  pointer-events: none;
}
