/* Custom Animations and Additional Styles */

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Fade In Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 1s ease-out;
}

/* Float Animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

/* Pulse Animation Delay */
.delay-1000 {
    animation-delay: 1s;
}

/* Navbar Scroll Effect */
#navbar {
    transition: all 0.3s ease;
}

#navbar.scrolled {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Smooth Link Hover */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #d4af37;
    transition: width 0.3s ease;
}

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

/* Button Styles */
.btn-primary,
.btn-cta {
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover,
.btn-cta:hover {
    box-shadow: 0 6px 12px rgba(212, 175, 55, 0.4);
}

/* Chapter Card Hover Effect */
.chapter-card {
    transition: all 0.3s ease;
}

.chapter-card:hover {
    transform: translateX(10px);
}

/* FAQ Animation */
.faq-item {
    transition: all 0.3s ease;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-answer.active {
    max-height: 500px;
    padding-top: 1rem;
}

.faq-item i {
    transition: transform 0.3s ease;
}

.faq-item.active i {
    transform: rotate(180deg);
}

/* Gradient Text Effect */
.gradient-text {
    background: linear-gradient(135deg, #d4af37 0%, #ffd700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Card Shine Effect */
@keyframes shine {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

.shine-effect {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: shine 3s infinite;
}

/* Responsive Video Container */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}

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

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

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

::-webkit-scrollbar-thumb {
    background: #d4af37;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b8941f;
}

/* Loading Animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

/* Tooltip */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: #1a237e;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 14px;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Print Styles */
@media print {
    nav,
    footer,
    .btn-primary,
    .btn-cta {
        display: none;
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .chapter-card:hover {
        transform: translateX(5px);
    }
}

/* Accessibility - Focus States */
a:focus,
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid #d4af37;
    outline-offset: 2px;
}

/* Reduced Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Selection Color */
::selection {
    background-color: #d4af37;
    color: #fff;
}

::-moz-selection {
    background-color: #d4af37;
    color: #fff;
}

/* Image Lazy Loading Effect */
img {
    transition: opacity 0.3s ease;
}

img[loading="lazy"]:not([src]) {
    opacity: 0;
}

img[loading="lazy"][src] {
    opacity: 1;
}

/* Back to Top Button */
#back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: #d4af37;
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

#back-to-top:hover {
    background-color: #b8941f;
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

#back-to-top.show {
    display: flex;
}

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

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

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 9999px;
}

.badge-gold {
    background-color: #d4af37;
    color: white;
}

.badge-blue {
    background-color: #1a237e;
    color: white;
}

/* Card Hover Effects */
.card-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-lift:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Divider Decoration */
.section-divider {
    position: relative;
    text-align: center;
    margin: 3rem 0;
}

.section-divider::before,
.section-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 30%;
    height: 1px;
    background: linear-gradient(to right, transparent, #d4af37, transparent);
}

.section-divider::before {
    left: 0;
}

.section-divider::after {
    right: 0;
}

/* Text Reveal Animation */
@keyframes textReveal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.text-reveal {
    animation: textReveal 0.8s ease-out forwards;
}

/* Stagger Animation */
.stagger-item {
    opacity: 0;
    animation: fadeIn 0.6s ease-out forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }
.stagger-item:nth-child(7) { animation-delay: 0.7s; }
.stagger-item:nth-child(8) { animation-delay: 0.8s; }
.stagger-item:nth-child(9) { animation-delay: 0.9s; }
.stagger-item:nth-child(10) { animation-delay: 1s; }