.hero-code-editor-container {
    position: absolute;
    left: 5%;
    top: 50%;
    transform: translateY(-50%);
    perspective: 2000px;
    z-index: 5;
    opacity: 0;
    transition: opacity 1s ease;
}

.hero-code-editor-container.visible {
    opacity: 1;
}

.code-editor-3d {
    width: 580px;
    height: 420px;
    background: rgba(15, 15, 15, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    box-shadow:
        0 30px 80px rgba(0, 0, 0, 0.8),
        0 0 60px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: rotateY(15deg) rotateX(5deg);
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    backdrop-filter: blur(20px);
}

.code-editor-3d:hover {
    transform: rotateY(8deg) rotateX(2deg) translateZ(20px);
}

.editor-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.editor-dots {
    display: flex;
    gap: 0.4rem;
}

.editor-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
}

.editor-dot.red {
    background: #ff5f56;
}

.editor-dot.yellow {
    background: #ffbd2e;
}

.editor-dot.green {
    background: #27c93f;
}

.editor-title {
    flex: 1;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
}

.editor-content {
    padding: 1.5rem;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    color: #e0e0e0;
    height: calc(100% - 45px);
    overflow: hidden;
    position: relative;
}

.editor-content.scrollable {
    overflow-y: auto;
    animation: scrollbarAppear 0.8s ease forwards;
}

@keyframes scrollbarAppear {
    from {
        box-shadow: inset 0 0 0 rgba(255, 255, 255, 0);
    }

    to {
        box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.03);
    }
}

.editor-content::-webkit-scrollbar {
    width: 10px;
}

.editor-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 5px;
}

.editor-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 5px;
    transition: background 0.3s ease;
}

.editor-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.editor-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) rgba(255, 255, 255, 0.02);
}

.code-line {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.1rem;
    opacity: 0;
    transform: translateX(-10px);
}

.code-line.visible {
    animation: typeIn 0.3s ease forwards;
}

@keyframes typeIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.line-number {
    color: rgba(255, 255, 255, 0.25);
    user-select: none;
    min-width: 25px;
    text-align: right;
}

.line-content {
    flex: 1;
    white-space: pre;
}

.keyword {
    color: #c678dd;
    font-weight: 600;
}

.function-name {
    color: #61afef;
}

.string {
    color: #98c379;
}

.property {
    color: #e06c75;
}

.value {
    color: #d19a66;
}

.comment {
    color: rgba(255, 255, 255, 0.35);
    font-style: italic;
}

.operator {
    color: #56b6c2;
}

.bracket {
    color: #abb2bf;
}

.cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: #ffffff;
    animation: blink 1s infinite;
    vertical-align: text-bottom;
    margin-left: 1px;
}

@keyframes blink {

    0%,
    49% {
        opacity: 1;
    }

    50%,
    100% {
        opacity: 0;
    }
}

.editor-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.03) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: glowPulse 4s ease-in-out infinite;
}

@keyframes glowPulse {

    0%,
    100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(1);
    }

    50% {
        opacity: 0.6;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

.code-editor-docs-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding: 0.9rem 2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: rotateY(15deg) rotateX(5deg);
    transform-style: preserve-3d;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.code-editor-docs-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.code-editor-docs-btn:hover::before {
    left: 100%;
}

.code-editor-docs-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    transform: rotateY(8deg) rotateX(2deg) translateZ(15px) translateY(-3px);
    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.6),
        0 0 30px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.code-editor-docs-btn i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.code-editor-docs-btn:hover i {
    transform: translateX(3px);
}

.code-editor-docs-btn .btn-text {
    position: relative;
    z-index: 1;
}

@media (max-width: 1600px) {
    .code-editor-3d {
        width: 520px;
        height: 380px;
    }

    .editor-content {
        font-size: 0.75rem;
    }
}

@media (max-width: 1400px) {
    .code-editor-3d {
        width: 480px;
        height: 350px;
    }
}

@media (max-width: 1200px) {
    .hero-code-editor-container {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        margin: 0 auto;
        max-width: 100%;
        width: 100%;
        text-align: center;
        padding: 0;
        opacity: 1;
    }

    .code-editor-3d {
        transform: none !important;
        width: 100%;
        max-width: 600px;
        margin: 0 auto;
        height: auto;
        min-height: 350px;
    }

    .code-editor-3d:hover {
        transform: translateY(-5px) !important;
    }

    .code-editor-docs-btn {
        transform: none !important;
        margin: 1.5rem auto 0;
        width: fit-content;
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .hero-code-editor-container {
        margin-top: 1rem;
    }

    .code-editor-3d {
        height: 320px;
        border-radius: 10px;
    }

    .editor-content {
        padding: 1rem;
        font-size: 0.7rem;
        overflow-x: hidden;
    }

    .line-content {
        white-space: pre-wrap;
        word-break: break-all;
    }

    .editor-title {
        font-size: 0.7rem;
    }

    .code-editor-docs-btn {
        width: 100%;
        max-width: 280px;
        padding: 0.8rem 1.5rem;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero-code-editor-container {
        padding: 0 0.5rem;
    }

    .code-editor-3d {
        height: 280px;
    }

    .editor-content {
        padding: 0.75rem;
        font-size: 0.65rem;
    }

    .line-number {
        min-width: 18px;
        font-size: 0.6rem;
    }
}