/* Enhanced Apology & Redemption Styles */

@keyframes berry-bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes apology-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

@keyframes wiggle {
    0%, 100% {
        transform: rotate(-3deg);
    }
    50% {
        transform: rotate(3deg);
    }
}

@keyframes redemption-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(34, 197, 94, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(34, 197, 94, 0.6), 0 0 30px rgba(34, 197, 94, 0.4);
    }
}

@keyframes forgiveness-fill {
    0% {
        width: 0%;
    }
    100% {
        width: 74%;
    }
}

.berry-bounce {
    animation: berry-bounce 2s infinite;
}

.wiggle {
    animation: wiggle 1s ease-in-out infinite;
}

.pulse-apology {
    animation: apology-pulse 2s infinite;
}

.redemption-glow {
    animation: redemption-glow 3s infinite;
}

.forgiveness-meter {
    animation: forgiveness-fill 2s ease-out;
}

/* Gradient animations for dramatic effect */
@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

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

/* Geysergod Memorial Styles */
@keyframes memorial-honor {
    0%, 100% {
        border-color: #FCD34D;
    }
    50% {
        border-color: #F59E0B;
        box-shadow: 0 0 15px rgba(252, 211, 77, 0.5);
    }
}

.geysergod-memorial {
    animation: memorial-honor 2s infinite;
}

/* Link validation success animation */
@keyframes validation-success {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.validation-success {
    animation: validation-success 0.5s ease-out;
}

/* Apology counter styles */
@keyframes counter-increment {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
        color: #FCD34D;
    }
    100% {
        transform: scale(1);
    }
}

.counter-animate {
    animation: counter-increment 0.3s ease-out;
}

/* Enhanced loading spinner for comprehensive tests */
@keyframes comprehensive-spin {
    0% {
        transform: rotate(0deg);
        border-color: #6B46C1 transparent #6B46C1 transparent;
    }
    25% {
        border-color: #3B82F6 transparent #3B82F6 transparent;
    }
    50% {
        transform: rotate(180deg);
        border-color: #10B981 transparent #10B981 transparent;
    }
    75% {
        border-color: #F59E0B transparent #F59E0B transparent;
    }
    100% {
        transform: rotate(360deg);
        border-color: #6B46C1 transparent #6B46C1 transparent;
    }
}

.comprehensive-spinner {
    animation: comprehensive-spin 2s linear infinite;
    border-width: 3px;
    border-style: solid;
    border-radius: 50%;
}

/* Trust indicator styles */
.trust-indicator {
    position: relative;
    overflow: hidden;
}

.trust-indicator::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(34, 197, 94, 0.2), transparent);
    animation: trust-sweep 3s infinite;
}

@keyframes trust-sweep {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Apology corner special effects */
.apology-text {
    background: linear-gradient(45deg, #EF4444, #F59E0B, #FCD34D);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient-shift 3s ease infinite;
}

/* Geysergod-approved badge */
.geysergod-badge {
    position: relative;
    background: linear-gradient(45deg, #FCD34D, #F59E0B);
    border: 2px solid #D97706;
    box-shadow: 0 4px 15px rgba(252, 211, 77, 0.4);
}

.geysergod-badge::after {
    content: '🏆';
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 20px;
    animation: bounce 2s infinite;
}

/* Enhanced accessibility for apology sections */
@media (prefers-reduced-motion: reduce) {
    .berry-bounce,
    .wiggle,
    .pulse-apology,
    .redemption-glow,
    .gradient-animate {
        animation: none;
    }
}

/* High contrast mode for apology elements */
@media (prefers-contrast: high) {
    .apology-text {
        -webkit-text-fill-color: #DC2626;
        background: none;
    }
    
    .geysergod-badge {
        background: #FCD34D;
        border: 3px solid #000;
        color: #000;
        font-weight: 900;
    }
}

/* Mobile responsiveness for apology sections */
@media (max-width: 640px) {
    .apology-text {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .forgiveness-meter {
        height: 12px;
    }
    
    .geysergod-memorial {
        padding: 1rem;
        margin: 0.5rem 0;
    }
}

/* Smooth scrolling and focus management */
html {
    scroll-behavior: smooth;
}

.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.5);
    border-color: #6B46C1;
}

/* Custom scrollbar with berry theme */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: linear-gradient(45deg, #f1f5f9, #e2e8f0);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #6B46C1, #3B82F6);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #553C9A, #2563EB);
}

/* Selection highlighting with berry colors */
::selection {
    background: #6B46C1;
    color: white;
}

::-moz-selection {
    background: #6B46C1;
    color: white;
}

/* Print styles for apology documentation */
@media print {
    .apology-text,
    .geysergod-badge,
    .redemption-glow {
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
    
    .animate-pulse,
    .animate-bounce,
    .wiggle {
        animation: none;
    }
}