/* Animations and additional styles */

/* Animate on scroll */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger animations for grid items */
.books-grid .book-card:nth-child(1),
.blog-grid .blog-card:nth-child(1),
.inspirations-grid .inspiration-card:nth-child(1) {
  transition-delay: 0.1s;
}

.books-grid .book-card:nth-child(2),
.blog-grid .blog-card:nth-child(2),
.inspirations-grid .inspiration-card:nth-child(2) {
  transition-delay: 0.2s;
}

.books-grid .book-card:nth-child(3),
.blog-grid .blog-card:nth-child(3),
.inspirations-grid .inspiration-card:nth-child(3) {
  transition-delay: 0.3s;
}

.books-grid .book-card:nth-child(4),
.blog-grid .blog-card:nth-child(4),
.inspirations-grid .inspiration-card:nth-child(4) {
  transition-delay: 0.4s;
}

/* Loading indicators */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border: 3px solid rgba(58, 110, 165, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 0.8s linear infinite;
  z-index: 11;
}

@keyframes spin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Notification system */
.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  max-width: 350px;
}

.notification {
  background-color: white;
  border-radius: 5px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  margin-bottom: 10px;
  overflow: hidden;
  transform: translateX(120%);
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
}

.notification.show {
  transform: translateX(0);
}

.notification-content {
  padding: 15px;
  flex-grow: 1;
}

.notification p {
  margin: 0;
}

.close-notification {
  background: none;
  border: none;
  color: #777;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 10px;
  transition: color 0.3s ease;
}

.close-notification:hover {
  color: #333;
}

.notification.success {
  border-left: 4px solid #4CAF50;
}

.notification.error {
  border-left: 4px solid #F44336;
}

.notification.info {
  border-left: 4px solid #2196F3;
}

/* Lightbox for images */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 90vh;
  display: block;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
}

.close-lightbox {
  position: absolute;
  top: -40px;
  right: 0;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  transition: color 0.3s ease;
}

.close-lightbox:hover {
  color: #ddd;
}

/* Page transitions */
.page-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--primary-color);
  z-index: 9999;
  transform: translateY(100%);
}

.page-transition.active {
  animation: pageTransition 1.5s ease-in-out forwards;
}

@keyframes pageTransition {
  0% {
    transform: translateY(100%);
  }
  50% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-100%);
  }
}

/* Button hover effects */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn:hover::after {
  width: 300%;
  height: 300%;
}

/* Hover effects for cards */
.book-card, .blog-card, .event-card {
  position: relative;
}

.book-card::before, .blog-card::before, .event-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(58, 110, 165, 0.1) 0%, rgba(58, 110, 165, 0) 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.book-card:hover::before, .blog-card:hover::before, .event-card:hover::before {
  opacity: 1;
}

/* Timeline animations */
.timeline-item {
  position: relative;
}

.timeline-item::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 20px;
  width: 2px;
  background-color: var(--primary-color);
  opacity: 0.3;
}

.timeline-year {
  position: relative;
  z-index: 2;
}

.timeline-year::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 20px;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  background-color: var(--primary-color);
  border-radius: 50%;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.timeline-item:hover .timeline-year::before {
  transform: translate(-50%, -50%) scale(1.3);
  background-color: var(--secondary-color);
}

/* Pulse animation for CTA elements */
.cta-pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(58, 110, 165, 0.4);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(58, 110, 165, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(58, 110, 165, 0);
  }
}

/* Text reveal animation */
.text-reveal {
  position: relative;
  overflow: hidden;
}

.text-reveal span {
  display: inline-block;
  transform: translateY(100%);
  opacity: 0;
  animation: textReveal 0.5s forwards;
}

@keyframes textReveal {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Staggered text reveal */
.text-reveal span:nth-child(1) { animation-delay: 0.1s; }
.text-reveal span:nth-child(2) { animation-delay: 0.2s; }
.text-reveal span:nth-child(3) { animation-delay: 0.3s; }
.text-reveal span:nth-child(4) { animation-delay: 0.4s; }
.text-reveal span:nth-child(5) { animation-delay: 0.5s; }

/* Image hover effects */
.hover-zoom {
  overflow: hidden;
}

.hover-zoom img {
  transition: transform 0.5s ease;
}

.hover-zoom:hover img {
  transform: scale(1.1);
}

/* Fade-in animation */
.fade-in {
  animation: fadeIn 1s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Slide-in animations */
.slide-in-left {
  animation: slideInLeft 1s ease forwards;
}

.slide-in-right {
  animation: slideInRight 1s ease forwards;
}

.slide-in-up {
  animation: slideInUp 1s ease forwards;
}

.slide-in-down {
  animation: slideInDown 1s ease forwards;
}

@keyframes slideInLeft {
  from {
    transform: translateX(-50px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(50px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideInDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Error state for form fields */
input.error, textarea.error {
  border: 1px solid #F44336;
  background-color: rgba(244, 67, 54, 0.05);
}

/* Success state for form fields */
input.success, textarea.success {
  border: 1px solid #4CAF50;
  background-color: rgba(76, 175, 80, 0.05);
}

/* Floating labels for form fields */
.floating-label {
  position: relative;
}

.floating-label input,
.floating-label textarea {
  height: 56px;
  padding: 20px 16px 0;
}

.floating-label label {
  position: absolute;
  top: 16px;
  left: 16px;
  color: #777;
  transition: all 0.2s ease;
  pointer-events: none;
}

.floating-label input:focus + label,
.floating-label textarea:focus + label,
.floating-label input:not(:placeholder-shown) + label,
.floating-label textarea:not(:placeholder-shown) + label {
  top: 8px;
  font-size: 0.75rem;
  color: var(--primary-color);
}

/* Shimmer effect for loading states */
.shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}

.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-color);
  color: white;
  padding: 8px 16px;
  z-index: 1001;
  transition: top 0.3s ease;
}

.skip-to-content:focus {
  top: 0;
}

.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
    padding: 15px;
    z-index: 999;
    display: none;
}

.cookie-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.cookie-buttons {
    display: flex;
    gap: 10px;
}

@media (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
    
    .cookie-buttons {
        margin-top: 15px;
    }
}

.error-page {
    padding: 100px 0;
    text-align: center;
}

.error-content h1 {
    font-size: 8rem;
    color: var(--primary-color);
    margin: 0;
    line-height: 1;
}

.error-content h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.error-content p {
    max-width: 600px;
    margin: 0 auto 30px;
}
