/* enhancements/enhancements.css */
@import url('./typography.css');

.enhanced {
    /* Scope for all enhancements */
    position: relative;
    z-index: 1;
}

/* Enhanced Terminal Modal */
.terminal-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.terminal-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.terminal-window {
    width: 90%;
    max-width: 800px;
    height: 60vh;
    background: #0d0d0d;
    border: 1px solid var(--color-surface-translucent);
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.terminal-header {
    background: #1a1a1a;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
    font-family: monospace;
    font-size: 12px;
}

.terminal-controls {
    display: flex;
    gap: 8px;
}

.t-btn {
    width: 12px; height: 12px; border-radius: 50%; border: none; cursor: pointer;
}
.t-btn.close { background: #ff5f56; }
.t-btn.min { background: #ffbd2e; }
.t-btn.max { background: #27c93f; }

.terminal-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    line-height: 1.5;
    color: #e6e6e6;
}

.terminal-input-line {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.terminal-input-line span {
    color: var(--color-accent-primary);
    margin-right: 10px;
    font-weight: bold;
}

.terminal-input-line input {
    background: transparent;
    border: none;
    color: white;
    font-family: inherit;
    font-size: inherit;
    flex: 1;
    outline: none;
}

/* iframe Sandboxes */
.playground-sandbox {
    width: 100%;
    height: 500px;
    border: 1px solid var(--color-surface-translucent);
    margin-top: 20px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    display: none; /* revealed via toggle */
}

.playground-sandbox iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #111;
}

/* Architecture Map */
.architecture-container {
    width: 100%;
    min-height: 500px;
    background: var(--color-bg-void);
    border-top: 1px solid var(--color-surface-translucent);
    border-bottom: 1px solid var(--color-surface-translucent);
    position: relative;
    padding: 2rem 5vw;
}

.architecture-svg-canvas {
    width: 100%;
    height: 400px;
    margin-top: 2rem;
    overflow: hidden;
    position: relative;
}

/* 3D Hero */
#hero-canvas.enhanced-hero {
    position: absolute;
    inset: 0;
    z-index: -1; /* Behind text but visible */
    pointer-events: none; /* Let clicks pass to DOM */
}

.hero-poster-fallback {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.2;
    mask-image: linear-gradient(to bottom, black 50%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent);
}

/* Custom Cursors */
body[data-cursor-state="play"] { cursor: e-resize !important; }
body[data-cursor-state="drag"] { cursor: grab !important; }

/* Pulse animations for architecture */
@keyframes wire-pulse {
    0% { stroke-opacity: 0.2; stroke-width: 1; }
    50% { stroke-opacity: 1; stroke-width: 2; filter: drop-shadow(0 0 5px var(--color-accent-primary)); }
    100% { stroke-opacity: 0.2; stroke-width: 1; }
}

.svg-edge {
    stroke: var(--color-surface-translucent);
}

.svg-edge.pulse {
    animation: wire-pulse 2s infinite ease-in-out;
}

/* Skeletons */
.skeleton {
    background: linear-gradient(90px, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite linear;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Microinteractions */
.btn-spring {
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.btn-spring:hover {
    transform: translateY(-2px) scale(1.02);
}

/* Modals */
.reproducibility-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(15,15,15,0.9);
    border: 1px solid #333;
    padding: 15px;
    border-radius: 8px;
    z-index: 1000;
    backdrop-filter: blur(5px);
    width: 300px;
}

.reproducibility-widget h4 {
    color: var(--color-accent-primary);
    margin: 0 0 10px 0;
    font-size: 12px;
    text-transform: uppercase;
    font-family: monospace;
}

.reproducibility-widget p {
    font-size: 11px;
    color: #aaa;
    margin: 0 0 5px 0;
}

.reproducibility-widget input {
    width: 100%;
    background: #000;
    border: 1px solid #333;
    color: #fff;
    padding: 5px;
    font-size: 11px;
    font-family: monospace;
    cursor: text;
}

/* Accessibility */
:focus-visible {
    outline: 2px solid var(--color-accent-primary);
    outline-offset: 2px;
}
