/* ==============================================
   CODE ANIMATION - Janela de código estilo IDE
   ============================================== */

.code-animation-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.code-window {
    background: #1e1e2e;
    border-radius: 12px;
    overflow: hidden;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(124, 58, 237, 0.15),
        0 0 100px rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(124, 58, 237, 0.3);
    font-family: 'JetBrains Mono', 'Fira Code', 'Source Code Pro', monospace;
}

.code-window-header {
    background: linear-gradient(180deg, #2d2d3f 0%, #252535 100%);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(124, 58, 237, 0.2);
}

.code-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.code-dot.red {
    background: #ff5f56;
}

.code-dot.yellow {
    background: #ffbd2e;
}

.code-dot.green {
    background: #27ca40;
}

.code-filename {
    margin-left: auto;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.code-content {
    padding: 20px;
    font-size: 0.85rem;
    line-height: 1.6;
    color: #cdd6f4;
    overflow-x: auto;
    min-height: 280px;
}

.code-content pre {
    margin: 0;
    white-space: pre;
}

.code-content code {
    font-family: inherit;
}

/* Syntax Highlighting - cores inspiradas em Catppuccin/One Dark */
.code-keyword {
    color: #cba6f7;
    /* roxo */
}

.code-string {
    color: #a6e3a1;
    /* verde */
}

.code-function {
    color: #89b4fa;
    /* azul */
}

.code-property {
    color: #f9e2af;
    /* amarelo */
}

.code-boolean {
    color: #fab387;
    /* laranja */
}

.code-type {
    color: #94e2d5;
    /* teal - para tipos TypeScript */
}

.code-comment {
    color: #6c7086;
    font-style: italic;
}

/* Cursor piscando */
.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: #06b6d4;
    animation: cursor-blink 1s infinite;
    vertical-align: text-bottom;
    margin-left: 2px;
}

@keyframes cursor-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Efeito de brilho sutil no hover */
.code-window:hover {
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 80px rgba(124, 58, 237, 0.25),
        0 0 120px rgba(6, 182, 212, 0.15);
    transform: translateY(-5px);
    transition: all 0.4s ease;
}

.code-window {
    transition: all 0.4s ease;
}

/* Responsivo */
@media (max-width: 768px) {
    .code-animation-container {
        max-width: 100%;
    }

    .code-content {
        font-size: 0.75rem;
        padding: 15px;
        min-height: 220px;
    }

    .code-window-header {
        padding: 10px 12px;
    }

    .code-dot {
        width: 10px;
        height: 10px;
    }
}

/* Light theme */
[data-theme="light"] .code-window {
    background: #f8fafc;
    border-color: #e2e8f0;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.15),
        0 0 60px rgba(124, 58, 237, 0.08);
}

[data-theme="light"] .code-window-header {
    background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 100%);
    border-color: #e2e8f0;
}

[data-theme="light"] .code-content {
    color: #1e293b;
}

[data-theme="light"] .code-keyword {
    color: #7c3aed;
}

[data-theme="light"] .code-string {
    color: #059669;
}

[data-theme="light"] .code-function {
    color: #2563eb;
}

[data-theme="light"] .code-property {
    color: #d97706;
}

[data-theme="light"] .code-boolean {
    color: #ea580c;
}

[data-theme="light"] .code-filename {
    color: rgba(0, 0, 0, 0.4);
}

/* Hero specific code animation */
.hero-code {
    max-width: 450px;
}

.hero-code .code-window {
    animation: float-code 6s ease-in-out infinite;
}

@keyframes float-code {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Glow effect on hero code */
.hero-code .code-window::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.1) 0%, transparent 70%);
    animation: rotate-glow 10s linear infinite;
    z-index: -1;
}

@keyframes rotate-glow {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}