/* CAA Readiness Index - Custom Styles */

/* Logo Protection - Prevent downloading/saving */
img[alt="CRI Logo"], 
img[src*="cribooklogo"] {
    pointer-events: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    -webkit-touch-callout: none;
}

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

/* Custom Animations */
@keyframes blob {
    0% {
        transform: translate(0px, 0px) scale(1);
    }
    33% {
        transform: translate(30px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
    100% {
        transform: translate(0px, 0px) scale(1);
    }
}

.animate-blob {
    animation: blob 7s infinite;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

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

.fade-in {
    opacity: 0;
    animation: fadeInUp 0.8s ease-out forwards;
}

.animation-delay-200 {
    animation-delay: 0.2s;
}

.animation-delay-400 {
    animation-delay: 0.4s;
}

.animation-delay-600 {
    animation-delay: 0.6s;
}

/* Navigation Enhancement */
#navbar.scrolled {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(to right, #1e3a8a, #14b8a6);
    transition: width 0.3s ease;
}

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

/* Button Enhancements */
.btn-primary {
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

/* CTA Button Glow Effect */
.btn-cta {
    position: relative;
    box-shadow: 0 20px 60px -10px rgba(30, 58, 138, 0.4);
}

.btn-cta::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #1e3a8a, #14b8a6, #1e3a8a);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: glow 3s linear infinite;
}

@keyframes glow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.btn-cta:hover::after {
    opacity: 0.8;
}

/* Feature Card Hover Effects */
.feature-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, #1e3a8a, #14b8a6);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.feature-card:hover::before {
    opacity: 1;
}

/* Form Input Enhancements */
input[type="number"]:focus,
input[type="text"]:focus {
    transform: scale(1.01);
}

/* Radio Button Custom Style */
input[type="radio"]:checked + div {
    box-shadow: 0 4px 6px -1px rgba(30, 58, 138, 0.2), 0 2px 4px -1px rgba(30, 58, 138, 0.1);
}

/* Results Container Animation */
#results-container {
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        max-height: 2000px;
        transform: translateY(0);
    }
}

/* Gradient Text Animation */
@keyframes gradient-shift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.text-transparent {
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
}

/* Progress Bar Animation */
@keyframes progress {
    from {
        width: 0%;
    }
    to {
        width: 100%;
    }
}

/* Pulse Animation for Badge */
@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(20, 184, 166, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(20, 184, 166, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(20, 184, 166, 0);
    }
}

.animate-pulse {
    animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

.loading-spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 0.8s linear infinite;
}

/* Tooltip Enhancement */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 12px;
    background: #1f2937;
    color: white;
    font-size: 12px;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
}

[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-12px);
}

/* Stats Counter Animation */
.stat-number {
    font-variant-numeric: tabular-nums;
}

/* Footer Link Hover */
footer a {
    position: relative;
    transition: all 0.3s ease;
}

footer a::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: #14b8a6;
    transition: width 0.3s ease;
}

footer a:hover::before {
    width: 100%;
}

/* Chart Container Styles */
.chart-container {
    position: relative;
    height: 300px;
}

/* Responsive Video/Image Embed */
.embed-responsive {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 ratio */
    height: 0;
    overflow: hidden;
}

.embed-responsive iframe,
.embed-responsive img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Mobile Menu Slide Animation */
#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

#mobile-menu.show {
    max-height: 400px;
}

/* Focus Visible for Accessibility */
*:focus-visible {
    outline: 2px solid #14b8a6;
    outline-offset: 2px;
}

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

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

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .btn-primary,
    .btn-cta {
        border: 2px solid currentColor;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    /* Uncomment to add dark mode support
    body {
        background: #111827;
        color: #f9fafb;
    }
    */
}
