/* Custom CSS для интерактивного лендинга */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    scroll-behavior: smooth;
}

/* Hero Section Styles */
.neural-brain {
    position: relative;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.brain-container {
    position: relative;
    filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.3));
}

.neural-nodes {
    position: absolute;
    inset: 0;
}

.neural-connections {
    position: absolute;
    inset: 0;
}

/* Создаем нейронные узлы */
.neural-nodes::before,
.neural-nodes::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: linear-gradient(45deg, #3b82f6, #8b5cf6);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.neural-nodes::before {
    top: 20%;
    left: 30%;
    animation-delay: 0s;
}

.neural-nodes::after {
    top: 60%;
    right: 25%;
    animation-delay: 1s;
}

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

/* Создаем нейронные связи */
.neural-connections::before,
.neural-connections::after {
    content: '';
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, transparent, #3b82f6, transparent);
    animation: flow 3s infinite;
}

.neural-connections::before {
    top: 25%;
    left: 20%;
    width: 60%;
    transform: rotate(15deg);
}

.neural-connections::after {
    top: 65%;
    left: 25%;
    width: 50%;
    transform: rotate(-25deg);
    animation-delay: 1.5s;
}

@keyframes flow {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* Progress Bar */
#progress-bar {
    transition: width 0.3s ease;
}

/* Navigation */
.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    transition: width 0.3s ease;
}

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

/* Tokens Section */
.token {
    display: inline-block;
    padding: 4px 8px;
    margin: 2px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    animation: tokenAppear 0.5s ease forwards;
    opacity: 0;
    transform: translateY(10px);
}

@keyframes tokenAppear {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.token-color-1 { background: rgba(59, 130, 246, 0.3); border: 1px solid #3b82f6; }
.token-color-2 { background: rgba(139, 92, 246, 0.3); border: 1px solid #8b5cf6; }
.token-color-3 { background: rgba(16, 185, 129, 0.3); border: 1px solid #10b981; }
.token-color-4 { background: rgba(245, 158, 11, 0.3); border: 1px solid #f59e0b; }
.token-color-5 { background: rgba(239, 68, 68, 0.3); border: 1px solid #ef4444; }

/* Context Window */
.context-belt {
    position: relative;
    overflow: hidden;
}

.context-item {
    display: inline-block;
    padding: 4px 8px;
    margin: 2px;
    background: rgba(59, 130, 246, 0.2);
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    animation: contextFlow 2s infinite linear;
}

@keyframes contextFlow {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100px); }
}

.context-item.old {
    opacity: 0.3;
    animation: fadeOut 1s ease forwards;
}

@keyframes fadeOut {
    to { opacity: 0; transform: translateX(-20px); }
}

/* Prompt Engineering */
.prompt-block {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.prompt-block:hover {
    border-color: rgba(59, 130, 246, 0.3);
}

.prompt-block.filled {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.quality-bar {
    background: linear-gradient(90deg, #ef4444, #f59e0b, #10b981);
    border-radius: 4px;
}

/* Temperature */
.temperature-slider {
    background: linear-gradient(90deg, #3b82f6, #ef4444);
}

.brain-cold {
    background: radial-gradient(circle, #3b82f6, #1e40af);
}

.brain-hot {
    background: radial-gradient(circle, #ef4444, #dc2626);
}

/* Sliders */
input[type="range"] {
    -webkit-appearance: none;
    background: transparent;
}

input[type="range"]::-webkit-slider-track {
    background: linear-gradient(90deg, #3b82f6, #ef4444);
    height: 8px;
    border-radius: 4px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    background: white;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

input[type="range"]::-moz-range-track {
    background: linear-gradient(90deg, #3b82f6, #ef4444);
    height: 8px;
    border-radius: 4px;
    border: none;
}

input[type="range"]::-moz-range-thumb {
    background: white;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 3rem;
    }
    
    .hero p {
        font-size: 1.2rem;
    }
    
    .neural-brain {
        transform: scale(0.8);
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    nav {
        display: none;
    }
}

/* Animations */
.fade-in {
    animation: fadeIn 1s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.slide-in-left {
    animation: slideInLeft 0.8s ease forwards;
}

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

.slide-in-right {
    animation: slideInRight 0.8s ease forwards;
}

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

/* Scroll Animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Button Hover Effects */
button {
    transition: all 0.3s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
}

/* Certificate */
#completion-certificate {
    animation: certificateGlow 2s infinite alternate;
}

@keyframes certificateGlow {
    from { box-shadow: 0 0 20px rgba(59, 130, 246, 0.3); }
    to { box-shadow: 0 0 40px rgba(139, 92, 246, 0.5); }
}

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

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #3b82f6, #8b5cf6);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #2563eb, #7c3aed);
}

/* Selection */
::selection {
    background: rgba(59, 130, 246, 0.3);
    color: white;
}

/* Focus States */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}