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

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

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

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

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

/* Code highlighting */
pre code {
    font-family: "Courier New", Courier, monospace;
    tab-size: 2;
}

/* Animation for hover effects */
.transition {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Backdrop blur support */
.backdrop-blur-sm {
    backdrop-filter: blur(4px);
}

.backdrop-blur-lg {
    backdrop-filter: blur(24px);
}

/* Custom animations and visual effects */
@keyframes float {
    0%,
    100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

@keyframes draw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes particle-float {
    from {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    to {
        transform: translateY(-100vh) translateX(100px);
        opacity: 0;
    }
}

/* New animations for the advanced diagram */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(14, 165, 233, 0.5);
    }
    50% {
        box-shadow: 0 0 40px rgba(14, 165, 233, 0.8);
    }
}

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

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

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

.animate-draw {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    animation: draw 2s ease-out forwards;
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out;
}

/* Glowing effect */
.glow {
    filter: drop-shadow(0 0 20px rgba(14, 165, 233, 0.5));
}

/* Subtle grid background */
.grid-background {
    background-image:
        linear-gradient(rgba(14, 165, 233, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(14, 165, 233, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}

/* Tech pattern background */
.tech-pattern {
    background-image:
        radial-gradient(
            circle at 20% 50%,
            rgba(14, 165, 233, 0.1) 0%,
            transparent 50%
        ),
        radial-gradient(
            circle at 80% 80%,
            rgba(16, 185, 129, 0.1) 0%,
            transparent 50%
        ),
        radial-gradient(
            circle at 40% 80%,
            rgba(14, 165, 233, 0.05) 0%,
            transparent 50%
        );
}

/* Animated border */
.animated-border {
    position: relative;
    overflow: hidden;
}

.animated-border::before {
    content: "";
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #0ea5e9, #10b981, #0ea5e9);
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}

.animated-border:hover::before {
    opacity: 1;
}

/* Particles effect */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(14, 165, 233, 0.5);
    border-radius: 50%;
    animation: particle-float 20s infinite linear;
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(to right, #0ea5e9, #10b981);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Enhanced card styles for the advanced diagram */
.card-glow {
    position: relative;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.card-glow:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(14, 165, 233, 0.3);
}

.card-glow::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, #0ea5e9, #10b981);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.card-glow:hover::before {
    opacity: 0.3;
}

/* Glass morphism effect */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Enhanced hover effects */
.hover-scale {
    transition: transform 0.3s ease;
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Neon glow text */
.neon-glow {
    text-shadow: 0 0 10px currentColor, 0 0 20px currentColor, 0 0 30px currentColor;
}

/* Animated gradient background */
.animated-gradient-bg {
    background: linear-gradient(-45deg, #0ea5e9, #10b981, #0ea5e9, #10b981);
    background-size: 400% 400%;
    animation: gradient 15s ease infinite;
}

/* Card entrance animations */
.animate-fadeInScale {
    animation: fadeInScale 0.6s ease-out;
}

.animate-slideInLeft {
    animation: slideInLeft 0.6s ease-out;
}

.animate-slideInRight {
    animation: slideInRight 0.6s ease-out;
}

/* Enhanced shadows */
.shadow-glow-primary {
    box-shadow: 0 0 20px rgba(14, 165, 233, 0.5), 0 0 40px rgba(14, 165, 233, 0.3);
}

.shadow-glow-secondary {
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5), 0 0 40px rgba(16, 185, 129, 0.3);
}

/* Prose styles for legal pages */
.prose h2 {
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
}

.prose h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.prose p {
    margin-bottom: 1.25rem;
    line-height: 1.8;
}

.prose ul,
.prose ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

/* Mobile code block fixes */
@media (max-width: 640px) {
    pre {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    pre code {
        display: block;
        overflow-x: auto;
        white-space: pre;
        word-wrap: normal;
        font-size: 0.7rem;
        line-height: 1.4;
    }

    /* Specific fixes for code examples */
    .language-javascript {
        padding-right: 1rem;
    }
}

/* Prism.js overrides for dark theme */
pre[class*="language-"] {
    background: transparent !important;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

code[class*="language-"] {
    text-shadow: none;
    background: transparent !important;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.token.comment {
    color: #6a737d;
}

.token.string {
    color: #79c0ff;
}

.token.keyword {
    color: #ff7b72;
}

.token.function {
    color: #d2a8ff;
}

.token.punctuation {
    color: #c9d1d9;
}

.token.operator {
    color: #ff7b72;
}

code[class*="language-"],
pre[class*="language-"] {
    font-size: 0.9rem !important;
}
