/* Additional animations and effects for the documentation site */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.content {
    animation: fadeInUp 0.6s ease-out;
}

.feature {
    transition: all 0.3s ease;
    animation: float 6s ease-in-out infinite;
}

.feature:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.feature:nth-child(2) { animation-delay: -2s; }
.feature:nth-child(3) { animation-delay: -4s; }
.feature:nth-child(4) { animation-delay: -1s; }

.nav-btn {
    position: relative;
    overflow: hidden;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.nav-btn:hover::before {
    left: 100%;
}

.endpoint {
    transition: all 0.3s ease;
    border-left-width: 4px;
}

.endpoint:hover {
    border-left-width: 8px;
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.code-block {
    position: relative;
    transition: all 0.3s ease;
    white-space: pre-wrap !important;
    font-family: 'Courier New', Consolas, Monaco, monospace !important;
    line-height: 1.4;
    font-size: 14px;
}

.code-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.try-it {
    position: relative;
    overflow: hidden;
}

.try-it::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(255,255,255,0.05) 10px,
        rgba(255,255,255,0.05) 20px
    );
    animation: slide 20s linear infinite;
}

@keyframes slide {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: rgba(255,255,255,0.6);
    box-shadow: 0 0 10px rgba(255,255,255,0.3);
}

.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::after {
    width: 300px;
    height: 300px;
}

.response {
    animation: fadeInUp 0.4s ease-out;
}

/* Loading animation */
.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;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Particle effect background */
.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, #fff, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.5), transparent),
        radial-gradient(2px 2px at 160px 30px, #fff, transparent);
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: sparkle 20s linear infinite;
    opacity: 0.3;
}

@keyframes sparkle {
    0% { background-position: 0 0, 0 0, 0 0, 0 0, 0 0; }
    100% { background-position: 200px 200px, -200px 200px, 200px -200px, -200px -200px, 200px 200px; }
}

/* Responsive enhancements */
@media (max-width: 768px) {
    .features {
        grid-template-columns: 1fr;
    }
    
    .nav {
        padding: 10px;
    }
    
    .nav-btn {
        padding: 10px 20px;
        font-size: 0.9em;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .feature {
        animation: none;
    }
}

/* Print styles */
@media print {
    .nav, .try-it, .btn { display: none; }
    .content { box-shadow: none; padding: 20px; }
    .header { background: none; color: #333; }
}