/* Custom CSS Variables */
:root {
    --primary-red: #dc2626;
    --dark-red: #991b1b;
    --light-red: #ef4444;
    --gray-dark: #111827;
    --gray-medium: #374151;
    --gray-light: #6b7280;
}

/* Custom Font Classes */
.font-bebas {
    font-family: 'Bebas Neue', cursive;
}

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

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

::-webkit-scrollbar-track {
    background: #1f2937;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-red);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-red);
}

/* Floating Animation for Background Text */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(-5deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

@keyframes float-delayed {
    0%, 100% {
        transform: translateY(0px) rotate(3deg);
    }
    50% {
        transform: translateY(-15px) rotate(-3deg);
    }
}

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

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

/* Glow Effect */
.glow-red {
    text-shadow: 0 0 20px rgba(220, 38, 38, 0.5);
}

/* Interactive Card Effects */
.reason-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.reason-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(220, 38, 38, 0.1), transparent);
    transition: left 0.5s ease;
}

.reason-card:hover::before {
    left: 100%;
}

/* Timeline Styles */
.timeline-item {
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 48px;
    top: 60px;
    bottom: -48px;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-red), transparent);
}

.timeline-item:last-child::before {
    display: none;
}

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

.counter.animated {
    animation: countUp 0.6s ease-out;
}

/* Gallery Hover Effects */
.gallery-item {
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(220, 38, 38, 0.3);
}

/* Button Hover Effects */
.btn-hover {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

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

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

/* Loading Animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

/* Shake Animation for Roast Generator */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-2px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(2px);
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Mobile Menu Animation */
.mobile-menu-enter {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Selection Color */
::selection {
    background: var(--primary-red);
    color: white;
}

/* Focus States */
button:focus,
a:focus {
    outline: 2px solid var(--light-red);
    outline-offset: 2px;
}

/* Responsive Text Sizes */
@media (max-width: 768px) {
    .hero-title {
        font-size: 3rem;
    }

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

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: var(--gray-dark);
    }
}

/* Custom Animations for AOS */
[data-aos="fade-up"] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-aos="fade-up"].aos-animate {
    opacity: 1;
    transform: translateY(0);
}

[data-aos="zoom-in"] {
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-aos="zoom-in"].aos-animate {
    opacity: 1;
    transform: scale(1);
}

/* Progress Bar Animation */
@keyframes progressFill {
    from {
        width: 0;
    }
}

.annoyance-level .bg-red-500 {
    animation: progressFill 1.5s ease-out;
}

/* Interactive Hover States */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Text Gradient Effect */
.text-gradient {
    background: linear-gradient(135deg, var(--light-red), var(--primary-red));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Border Animation */
.border-animate {
    position: relative;
    background: linear-gradient(var(--gray-dark), var(--gray-dark)) padding-box,
                linear-gradient(45deg, var(--light-red), var(--primary-red)) border-box;
    border: 2px solid transparent;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(220, 38, 38, 0.1);
    border-top: 4px solid var(--primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive Grid Adjustments */
@media (max-width: 640px) {
    .grid-responsive {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Accessibility: High Contrast Mode */
@media (prefers-contrast: high) {
    .text-gray-400 {
        color: #d1d5db;
    }

    .bg-gray-800 {
        background-color: #1f2937;
    }

    .border-red-500\/30 {
        border-color: var(--primary-red);
    }
}

/* 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;
        scroll-behavior: auto !important;
    }
}

/* NEW FEATURES - TORTURE CHAMBER ANIMATIONS */

/* Slam Button Animation */
@keyframes buttonPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(220, 38, 38, 0);
    }
}

#slam-button button:active {
    animation: buttonPulse 0.3s ease-out;
}

/* Screen Shake Effect */
@keyframes screenShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.screen-shake {
    animation: screenShake 0.3s ease-in-out;
}

/* Particle Effects */
@keyframes particleExplosion {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0);
    }
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-red);
    border-radius: 50%;
    animation: particleExplosion 0.6s ease-out forwards;
}

/* Craig-O-Meter Animation */
@keyframes meterGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(220, 38, 38, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(220, 38, 38, 0.8);
    }
}

#craig-meter-fill {
    animation: meterGlow 2s ease-in-out infinite;
}

/* Achievement Unlock Animation */
@keyframes achievementPop {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(10deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.achievement-unlock {
    animation: achievementPop 0.6s ease-out;
}

/* Combo Effect */
@keyframes comboFlash {
    0%, 100% {
        background-color: var(--primary-red);
    }
    50% {
        background-color: var(--light-red);
    }
}

.combo-active {
    animation: comboFlash 0.3s ease-in-out;
}

/* COMMUNITY FEATURES ANIMATIONS */

/* Confession Card Animation */
@keyframes slideInConfession {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.confession-card {
    animation: slideInConfession 0.5s ease-out;
}

/* Hate Mail Send Animation */
@keyframes mailSend {
    0% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-20px) scale(1.1);
    }
    100% {
        transform: translateY(-100px) scale(0);
        opacity: 0;
    }
}

.mail-sending {
    animation: mailSend 0.8s ease-out forwards;
}

/* Wanted Poster Poster Effect */
@keyframes posterFlip {
    0% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(90deg);
    }
    100% {
        transform: rotateY(0deg);
    }
}

.poster-updating {
    animation: posterFlip 0.6s ease-in-out;
}

/* BINGO GAME ANIMATIONS */

@keyframes bingoCardShuffle {
    0% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(0.95) rotate(2deg);
    }
    50% {
        transform: scale(1.05) rotate(-2deg);
    }
    75% {
        transform: scale(0.98) rotate(1deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

.bingo-shuffle {
    animation: bingoCardShuffle 0.5s ease-in-out;
}

@keyframes bingoWin {
    0% {
        transform: scale(1);
        background-color: #10b981;
    }
    25% {
        transform: scale(1.1);
        background-color: #34d399;
    }
    50% {
        transform: scale(1.2);
        background-color: #6ee7b7;
    }
    100% {
        transform: scale(1);
        background-color: #10b981;
    }
}

.bingo-win-square {
    animation: bingoWin 1s ease-in-out;
}

/* GAME ANIMATIONS */

/* Catch Craig Target Animation */
@keyframes targetMove {
    0% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.craig-target-new {
    animation: targetMove 0.3s ease-out;
}

@keyframes targetHit {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.5);
        background-color: var(--light-red);
    }
    100% {
        transform: scale(1);
        background-color: var(--primary-red);
    }
}

.craig-target-hit {
    animation: targetHit 0.2s ease-out;
}

/* Soundboard Button Animation */
@keyframes soundWave {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 20px rgba(220, 38, 38, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
    }
}

.sound-btn:active {
    animation: soundWave 0.5s ease-out;
}

/* ADVANCED FEATURES ANIMATIONS */

/* Chat Message Animation */
@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message {
    animation: messageSlideIn 0.3s ease-out;
}

/* Craig AI Thinking Animation */
@keyframes thinkingDots {
    0%, 80%, 100% {
        opacity: 0;
    }
    40% {
        opacity: 1;
    }
}

.thinking-dot {
    animation: thinkingDots 1.4s ease-in-out infinite;
}

.thinking-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.thinking-dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* Disaster Timer Animation */
@keyframes timerPulse {
    0%, 100% {
        color: var(--primary-red);
        text-shadow: 0 0 10px rgba(220, 38, 38, 0.5);
    }
    50% {
        color: var(--light-red);
        text-shadow: 0 0 20px rgba(220, 38, 38, 0.8);
    }
}

#disaster-timer {
    animation: timerPulse 2s ease-in-out infinite;
}

/* Horror Scope Animation */
@keyframes crystalBallGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(139, 92, 246, 0.6);
    }
}

.crystal-ball-effect {
    animation: crystalBallGlow 3s ease-in-out infinite;
}

/* INSULT CALCULATOR ANIMATIONS */

@keyframes calculationSpin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.calculating {
    animation: calculationSpin 1s linear infinite;
}

/* CRIME DATABASE ANIMATIONS */

@keyframes crimeReportPulse {
    0%, 100% {
        border-color: rgba(220, 38, 38, 0.3);
    }
    50% {
        border-color: rgba(220, 38, 38, 0.8);
    }
}

.crime-report-new {
    animation: crimeReportPulse 2s ease-in-out 3;
}

/* LOADING AND SMOOTH TRANSITIONS */

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

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

/* Interactive Button Styles */
.interactive-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

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

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

/* Responsive Adjustments for New Features */
@media (max-width: 768px) {
    .bingo-square {
        font-size: 8px;
        min-height: 50px;
        padding: 4px;
    }

    #slam-button button {
        font-size: 1.5rem;
        padding: 2rem;
    }

    .craig-meter {
        font-size: 0.8rem;
    }

    .chat-message {
        font-size: 0.8rem;
    }
}

/* Enhanced Accessibility */
@media (prefers-contrast: high) {
    .bingo-square {
        border-width: 2px;
        border-color: var(--primary-red);
    }

    .interactive-btn {
        border-width: 2px;
    }

    #craig-meter-fill {
        border: 1px solid white;
    }
}

/* Performance Optimizations */
.will-change-transform {
    will-change: transform;
}

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Easter Egg Animations */
@keyframes rainbowText {
    0% { color: #ff0000; }
    16% { color: #ff8800; }
    33% { color: #ffff00; }
    50% { color: #00ff00; }
    66% { color: #0088ff; }
    83% { color: #8800ff; }
    100% { color: #ff0000; }
}

.rainbow-mode {
    animation: rainbowText 3s linear infinite;
}