* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #1a1a1a, #2a2a2a);
    min-height: 100vh;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    color: #e0e0e0;
}

.container {
    display: flex;
    min-height: 100vh;
    gap: 20px;
    padding: 20px;
}

.demo-section {
    flex: 1;
}

.demo-area {
    flex: 1;
    position: relative;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    min-height: 400px;
    width: max(300px, calc(100vw - 610px));
    height: max(200px, calc(100vh - 40px));
}

iframe {
    width: 100%;
    height: 100%;

    border: none;
    display: block;
    border-radius: 12px;
}

.resize-handle {
    position: absolute;
    bottom: -20px;
    right: -20px;
    width: 40px;
    height: 40px;
    background: linear-gradient(45deg, #e06c75, #c678dd);
    cursor: se-resize;
    z-index: 10;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(224, 108, 117, 0.4);
    animation: pulse 2s infinite;
}

.resize-handle:hover {
    background: linear-gradient(45deg, #e76f7a, #d084e0);
    transform: scale(1.2);
    box-shadow: 0 8px 24px rgba(224, 108, 117, 0.6);
    animation: none;
}

.resize-handle::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M16 0v16H0z" fill="none"/><path d="M12 4l-8 8M12 8v4h4M4 12h4v-4" stroke="white" stroke-width="2" fill="none"/></svg>')
        no-repeat center;
    background-size: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

@keyframes pulse {
    0%,
    100% {
        box-shadow: 0 6px 20px rgba(224, 108, 117, 0.4);
        border-color: rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow: 0 6px 20px rgba(224, 108, 117, 0.7);
        border-color: rgba(255, 255, 255, 0.5);
    }
}

.info-panel {
    width: 550px;
    min-width: 550px;
    max-width: 550px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
    height: fit-content;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.info-panel h2 {
    margin: 0 0 16px 0;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    border-bottom: 2px solid rgba(128, 128, 128, 0.3);
    padding-bottom: 8px;
}

.info-panel h3 {
    margin: 20px 0 8px 0;
    font-size: 16px;
    font-weight: 500;
    color: #e5c07b;
}

.info-panel p {
    margin: 0 0 12px 0;
    font-size: 14px;
    line-height: 1.6;
    color: #c0c0c0;
}

.info-panel ul {
    margin: 8px 0;
    padding-left: 20px;
}

.info-panel li {
    margin: 6px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #b0b0b0;
}

.hljs {
    background: #282c34 !important;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 12px;
    font-family: "Consolas", "Monaco", monospace;
    font-size: 13px;
    margin: 12px 0;
    overflow-x: auto;
    color: #abb2bf;
    line-height: 1.4;
}

pre {
    margin: 0;
    white-space: pre;
}
/* One Dark theme tokens for Zed-style syntax highlighting */

.hljs-keyword,
.hljs-operator,
.hljs-pattern-match {
    color: #c678dd;
    font-weight: bold;
}

.hljs-function,
.hljs-title {
    color: #61afef;
}

.hljs-class {
    color: #e5c07b;
}

.hljs-number {
    color: #d19a66;
}

.hljs-string,
.hljs-meta-string {
    color: #98c379;
}

.hljs-variable,
.hljs-template-variable {
    color: #e06c75;
}

.hljs-type,
.hljs-built_in {
    color: #56b6c2;
}

.hljs-comment {
    color: #5c6370;
    font-style: italic;
}

.hljs-meta {
    color: #5c6370;
}

.hljs-tag {
    color: #e06c75;
}

.hljs-attribute,
.hljs-attr {
    color: #d19a66;
}

.hljs-literal {
    color: #56b6c2;
}

.hljs-name {
    color: #e06c75;
}

.hljs-selector-tag {
    color: #e06c75;
}

.hljs-selector-id,
.hljs-selector-class {
    color: #d19a66;
}

.highlight {
    color: #e06c75;
    font-weight: 500;
}

.warning {
    background: rgba(255, 165, 0, 0.1);
    border: 1px solid rgba(255, 165, 0, 0.3);
    border-radius: 6px;
    padding: 12px;
    margin: 12px 0;
    font-size: 13px;
    color: #ffcc80;
}

.navigation {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.nav-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px 16px;
    text-decoration: none;
    color: #c0c0c0;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 140px;
    justify-content: center;
}

.nav-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-1px);
}

.nav-button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-button .arrow {
    font-size: 14px;
}

.additional-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

.additional-actions .nav-button {
    flex: 1;
}

.nav-button-secondary {
    background: rgba(152, 195, 121, 0.1) !important;
    border-color: rgba(152, 195, 121, 0.3) !important;
    color: #98c379 !important;
}

.nav-button-secondary:hover {
    background: rgba(152, 195, 121, 0.2) !important;
    border-color: rgba(152, 195, 121, 0.4) !important;
    color: #86b365 !important;
}

.nav-button-accent {
    background: rgba(229, 192, 123, 0.1) !important;
    border-color: rgba(229, 192, 123, 0.3) !important;
    color: #e5c07b !important;
}

.nav-button-accent:hover {
    background: rgba(229, 192, 123, 0.2) !important;
    border-color: rgba(229, 192, 123, 0.4) !important;
    color: #d4af69 !important;
}

@media (max-width: 1024px) {
    .container {
        flex-direction: column;
    }

    .info-panel {
        width: 100%;
        order: -1;
    }

    .demo-section {
        min-height: 500px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
        gap: 15px;
    }

    .demo-header h1 {
        font-size: 20px;
    }

    .info-panel {
        padding: 16px;
    }
}
