@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=JetBrains+Mono:wght@400;700&family=Quantico:wght@400;700&display=swap');

:root {
    --bg-dark: #05080a;
    --bg-panel: rgba(16, 20, 25, 0.85);
    --bg-input: rgba(0, 0, 0, 0.5);
    
    --neon-cyan: #00f3ff;
    --neon-magenta: #ff00ff;
    --neon-blue: #0088ff;
    --neon-green: #39ff14;
    --neon-yellow: #fff200;
    
    --text-primary: #e0f2ff;
    --text-secondary: #88a0b0;
    --text-dim: #445566;
    
    --border-cyan: rgba(0, 243, 255, 0.3);
    --glow-cyan: 0 0 10px rgba(0, 243, 255, 0.5);
    --glow-magenta: 0 0 10px rgba(255, 0, 255, 0.5);
    
    --font-ui: 'Orbitron', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

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

body {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 50% 50%, rgba(0, 40, 60, 0.2) 0%, transparent 80%),
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.05), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.05));
    background-size: 100% 100%, 100% 4px, 3px 100%;
    color: var(--text-primary);
    font-family: var(--font-ui);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 1rem;
    gap: 1rem;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-cyan);
    box-shadow: 0 4px 15px -10px var(--neon-cyan);
}

h1 {
    font-size: 1.5rem;
    letter-spacing: 2px;
    color: var(--neon-cyan);
    text-shadow: var(--glow-cyan);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

h1 .subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: 'Quantico', sans-serif;
    text-transform: uppercase;
    margin-top: 0.2rem;
}

.header-controls {
    display: flex;
    gap: 0.5rem;
}

/* Panels */
.main-content {
    display: grid;
    grid-template-columns: 400px 1fr 350px;
    gap: 1rem;
    flex: 1;
    min-height: 0;
}

.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-cyan);
    backdrop-filter: blur(10px);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
    opacity: 0.5;
}

.panel-header {
    padding: 0.75rem;
    background: rgba(0, 243, 255, 0.05);
    border-bottom: 1px solid var(--border-cyan);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--neon-cyan);
}

/* Editor */
.code-editor {
    flex: 1;
    background: var(--bg-input);
    color: var(--neon-green);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    padding: 1rem;
    border: none;
    outline: none;
    resize: none;
    line-height: 1.5;
    tab-size: 4;
}

/* Center Visualizer */
.visualizer-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
    overflow-y: auto;
}

.circuit-display {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 243, 255, 0.1);
    border-radius: 4px;
    padding: 1rem;
    min-height: 200px;
    position: relative;
}

.qubit-line {
    height: 30px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 10px;
    position: relative;
}

.qubit-label {
    width: 40px;
    font-size: 0.8rem;
    color: var(--neon-blue);
    font-weight: bold;
}

.qubit-wire {
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    position: relative;
}

.gate-icon {
    position: absolute;
    width: 24px;
    height: 24px;
    background: var(--neon-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 2px;
    box-shadow: 0 0 5px var(--neon-blue);
    transform: translate(-50%, -50%);
    top: 50%;
}

/* State Display */
.state-viewer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
}

.state-bubble {
    background: rgba(0, 30, 50, 0.5);
    border: 1px solid var(--border-cyan);
    padding: 0.5rem;
    border-radius: 4px;
    text-align: center;
}

.state-name {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.state-prob-bar {
    height: 4px;
    background: #111;
    border-radius: 2px;
    overflow: hidden;
}

.state-prob-fill {
    height: 100%;
    background: var(--neon-magenta);
    box-shadow: 0 0 5px var(--neon-magenta);
}

/* Right Panel */
.debug-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
}

.tab-btn {
    flex: 1;
    padding: 0.6rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: var(--neon-cyan);
    border-bottom-color: var(--neon-cyan);
    background: rgba(0, 243, 255, 0.05);
}

.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.tab-content.active {
    display: block;
}

/* Buttons */
.btn {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--neon-cyan);
    background: transparent;
    color: var(--neon-cyan);
    font-family: var(--font-ui);
    font-size: 0.75rem;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s;
    border-radius: 2px;
}

.btn:hover {
    background: var(--neon-cyan);
    color: var(--bg-dark);
    box-shadow: var(--glow-cyan);
}

.btn-magenta {
    border-color: var(--neon-magenta);
    color: var(--neon-magenta);
}

.btn-magenta:hover {
    background: var(--neon-magenta);
    box-shadow: var(--glow-magenta);
}

.btn-run {
    padding: 0.6rem 1.2rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Status Bar */
.status-bar {
    border-top: 1px solid var(--border-cyan);
    padding: 0.4rem 1rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.5);
}

.status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--neon-cyan);
    margin-right: 0.5rem;
    box-shadow: 0 0 5px var(--neon-cyan);
}

/* Animations */
@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}

.scanning {
    animation: pulse 2s infinite ease-in-out;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

::-webkit-scrollbar-thumb {
    background: var(--border-cyan);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--neon-cyan);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background: var(--bg-panel);
    border: 1px solid var(--neon-cyan);
    box-shadow: var(--glow-cyan);
    width: 500px;
    max-width: 90%;
    border-radius: 4px;
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-cyan);
    display: flex;
    justify-content: space-between;
}

.modal-body {
    padding: 1rem;
    font-size: 0.9rem;
    line-height: 1.6;
}

.samples-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 10px;
}

.sample-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--text-dim);
    padding: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.sample-item:hover {
    border-color: var(--neon-cyan);
    background: rgba(0, 243, 255, 0.05);
    transform: translateY(-2px);
}

.sample-item h4 {
    color: var(--neon-cyan);
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.sample-item p {
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.modal-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-cyan);
    display: flex;
    justify-content: flex-end;
}
