/* ============================================
   CPT OMNIFORGE - COMPLETE CSS STYLESHEET
   ============================================ */

/* Root Variables & Custom Properties */
:root {
    --primary-black: #0a0a0a;
    --secondary-black: #151515;
    --primary-cyan: #00ffff;
    --secondary-cyan: #00cccc;
    --accent-gold: #ffd700;
    --panel-bg: rgba(10, 10, 10, 0.85);
    --glass-bg: rgba(20, 20, 20, 0.7);
    --glass-border: rgba(0, 255, 255, 0.3);
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-dim: #808080;
    --error-red: #ff3366;
    --success-green: #00ff88;
    --warning-yellow: #ffcc00;
    --panel-shadow: 0 8px 32px rgba(0, 255, 255, 0.1);
    --glow-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-mono: 'Consolas', 'Monaco', 'Courier New', monospace;
    --font-display: 'Orbitron', 'Arial Black', sans-serif;
}

/* Global Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    background-color: var(--primary-black);
}

body {
    background-image: url('https://i.postimg.cc/1t5cybpV/Lucid-Realism-project-CPTOmni-Forge-Backgrounds-brandpalette-p-0.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(10, 10, 10, 0.95) 0%, 
        rgba(10, 10, 10, 0.85) 50%, 
        rgba(10, 10, 10, 0.95) 100%);
    z-index: -1;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--secondary-black);
    border: 1px solid var(--glass-border);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-cyan);
    border-radius: 5px;
    transition: var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-cyan);
    box-shadow: var(--glow-shadow);
}

/* Main App Container */
#app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Header Styles */
#main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 2px solid var(--glass-border);
    box-shadow: var(--panel-shadow);
    z-index: 1000;
    min-height: 80px;
}

/* Logo Container */
.logo-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* 3D Cube Animation */
.cpt-cube {
    width: 50px;
    height: 50px;
    position: relative;
    transform-style: preserve-3d;
    animation: rotateCube 10s infinite linear;
}

@keyframes rotateCube {
    0% { transform: rotateX(0deg) rotateY(0deg); }
    100% { transform: rotateX(360deg) rotateY(360deg); }
}

.cube-face {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 2px solid var(--primary-cyan);
    background: rgba(0, 255, 255, 0.1);
    box-shadow: inset 0 0 20px rgba(0, 255, 255, 0.3);
}

.cube-front { transform: translateZ(25px); }
.cube-back { transform: rotateY(180deg) translateZ(25px); }
.cube-left { transform: rotateY(-90deg) translateZ(25px); }
.cube-right { transform: rotateY(90deg) translateZ(25px); }
.cube-top { transform: rotateX(90deg) translateZ(25px); }
.cube-bottom { transform: rotateX(-90deg) translateZ(25px); }

/* Main Title */
.main-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 3px;
    text-shadow: 0 0 20px var(--primary-cyan);
    display: flex;
    gap: 0.5rem;
}

.main-title .cpt {
    color: var(--primary-cyan);
    animation: glowPulse 2s ease-in-out infinite;
}

.main-title .omniforge {
    color: var(--text-primary);
    background: linear-gradient(90deg, var(--primary-cyan), var(--secondary-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes glowPulse {
    0%, 100% { text-shadow: 0 0 20px var(--primary-cyan); }
    50% { text-shadow: 0 0 30px var(--primary-cyan), 0 0 40px var(--secondary-cyan); }
}

/* Header Controls */
.header-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Button Base Styles */
button {
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
    outline: none;
    position: relative;
    overflow: hidden;
}

button:focus-visible {
    outline: 2px solid var(--primary-cyan);
    outline-offset: 2px;
}

/* Primary Buttons */
.btn-run {
    background: linear-gradient(135deg, var(--primary-cyan), var(--secondary-cyan));
    color: var(--primary-black);
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 255, 255, 0.4);
    transform: translateY(0);
}

.btn-run:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 255, 255, 0.6);
}

.btn-run:active {
    transform: translateY(0);
}

.run-icon {
    font-size: 1.2rem;
    display: inline-block;
    transition: transform var(--transition-fast);
}

.btn-run:hover .run-icon {
    transform: translateX(3px);
}

/* Secondary Buttons */
.btn-clear, .btn-export, .btn-import {
    background: var(--glass-bg);
    color: var(--text-primary);
    padding: 0.5rem 1.5rem;
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

.btn-clear:hover, .btn-export:hover, .btn-import:hover {
    background: rgba(0, 255, 255, 0.1);
    border-color: var(--primary-cyan);
    box-shadow: var(--glow-shadow);
}

/* Privacy Badge */
.privacy-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.badge-icon {
    font-size: 1rem;
    color: var(--accent-gold);
}

/* Main Workspace */
#forge-workspace {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: 1fr auto;
    gap: 1rem;
    padding: 1rem;
    overflow: hidden;
    position: relative;
}

/* Panel Columns */
.panel-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 300px;
}

/* Code Panels */
.code-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: var(--panel-shadow);
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 200px;
    transition: var(--transition-smooth);
}

.code-panel.minimized {
    min-height: auto;
    height: auto;
}

.code-panel.minimized .panel-body {
    display: none;
}

.code-panel.maximized {
    position: fixed;
    top: 80px;
    left: 1rem;
    right: 1rem;
    bottom: 60px;
    z-index: 900;
    max-width: none;
    max-height: none;
}

/* Panel Header */
.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(0, 255, 255, 0.05);
    border-bottom: 1px solid var(--glass-border);
    cursor: move;
    user-select: none;
    border-radius: 12px 12px 0 0;
}

.panel-icon {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

.panel-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--primary-cyan);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Panel Controls */
.panel-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-minimize, .btn-maximize, .btn-close {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: transparent;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    border: 1px solid transparent;
}

.btn-minimize:hover, .btn-maximize:hover {
    background: rgba(0, 255, 255, 0.1);
    border-color: var(--glass-border);
    color: var(--primary-cyan);
}

.btn-close:hover {
    background: rgba(255, 51, 102, 0.1);
    border-color: var(--error-red);
    color: var(--error-red);
}

/* Panel Body */
.panel-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Editor Toolbar */
.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-format, .btn-copy {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    background: var(--glass-bg);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
}

.btn-format:hover, .btn-copy:hover {
    background: rgba(0, 255, 255, 0.1);
    color: var(--primary-cyan);
    border-color: var(--primary-cyan);
}

.char-count {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

/* Code Editor */
.code-editor {
    flex: 1;
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    border: none;
    outline: none;
    resize: none;
    tab-size: 2;
}

.code-editor::placeholder {
    color: var(--text-dim);
    opacity: 0.5;
}

.code-editor:focus {
    background: rgba(0, 0, 0, 0.6);
}

/* Syntax Highlighting (Basic) */
.code-editor.html-syntax {
    color: #e06c75;
}

.code-editor.css-syntax {
    color: #56b6c2;
}

.code-editor.js-syntax {
    color: #e5c07b;
}

/* Resize Handles */
.resize-handle {
    position: absolute;
    background: transparent;
    z-index: 10;
}

.resize-handle:hover {
    background: var(--primary-cyan);
    opacity: 0.3;
}

.resize-right {
    right: -4px;
    top: 0;
    bottom: 0;
    width: 8px;
    cursor: ew-resize;
}

.resize-left {
    left: -4px;
    top: 0;
    bottom: 0;
    width: 8px;
    cursor: ew-resize;
}

.resize-bottom {
    left: 0;
    right: 0;
    bottom: -4px;
    height: 8px;
    cursor: ns-resize;
}

.resize-top {
    left: 0;
    right: 0;
    top: -4px;
    height: 8px;
    cursor: ns-resize;
}

/* Output Container */
.output-container {
    background: var(--panel-bg);
    backdrop-filter: blur(15px);
    border: 2px solid var(--primary-cyan);
    border-radius: 12px;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* Output Header */
.output-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(0, 255, 255, 0.1);
    border-bottom: 2px solid var(--primary-cyan);
}

.output-icon {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.output-title {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-cyan);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--primary-cyan);
}

/* Output Controls */
.output-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-refresh, .btn-fullscreen, .btn-console {
    padding: 0.5rem 1rem;
    background: var(--glass-bg);
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    font-size: 0.9rem;
}

.btn-refresh:hover, .btn-fullscreen:hover, .btn-console:hover {
    background: rgba(0, 255, 255, 0.1);
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
}

/* Output Body */
.output-body {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
}

#output-frame {
    flex: 1;
    width: 100%;
    border: none;
    background: white;
}

/* Console Panel */
.console-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: rgba(0, 0, 0, 0.95);
    border-top: 1px solid var(--glass-border);
    display: none;
    flex-direction: column;
    z-index: 10;
}

.console-panel.active {
    display: flex;
}

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

.console-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.console-log {
    margin: 0.25rem 0;
    padding: 0.25rem;
    border-left: 3px solid transparent;
}

.console-log.info {
    color: var(--text-secondary);
    border-color: var(--primary-cyan);
}

.console-log.warn {
    color: var(--warning-yellow);
    border-color: var(--warning-yellow);
}

.console-log.error {
    color: var(--error-red);
    border-color: var(--error-red);
}

/* Bottom Row Panels */
.panel-row {
    grid-column: 1 / -1;
    display: flex;
    gap: 1rem;
    min-height: 60px;
}

.panel-row .code-panel {
    flex: 1;
}

/* Footer */
#main-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-top: 2px solid var(--glass-border);
    box-shadow: 0 -8px 32px rgba(0, 255, 255, 0.1);
    z-index: 1000;
}

.footer-left .tagline {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
    letter-spacing: 1px;
}

.footer-center .status {
    padding: 0.25rem 1rem;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--primary-cyan);
    font-weight: 500;
}

.footer-right {
    display: flex;
    gap: 0.5rem;
}

.btn-theme, .btn-help {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.btn-theme:hover, .btn-help:hover {
    background: rgba(0, 255, 255, 0.1);
    border-color: var(--primary-cyan);
    transform: rotate(15deg);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn var(--transition-fast);
}

.modal-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal Content */
.modal-content {
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--primary-cyan);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 255, 255, 0.3);
    animation: slideUp var(--transition-smooth);
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

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

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-cyan);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 51, 102, 0.1);
    border-color: var(--error-red);
    color: var(--error-red);
    transform: rotate(90deg);
}

.modal-body {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--glass-border);
}

.btn-modal-cancel, .btn-modal-confirm {
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-modal-cancel {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
}

.btn-modal-cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-modal-confirm {
    background: linear-gradient(135deg, var(--primary-cyan), var(--secondary-cyan));
    color: var(--primary-black);
    border: none;
}

.btn-modal-confirm:hover {
    box-shadow: 0 4px 20px rgba(0, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    text-align: center;
}

.spinner-cube {
    width: 60px;
    height: 60px;
    margin: 0 auto 2rem;
    position: relative;
    transform-style: preserve-3d;
    animation: spinCube 2s infinite ease-in-out;
}

@keyframes spinCube {
    0% { transform: rotateX(0) rotateY(0); }
    100% { transform: rotateX(360deg) rotateY(360deg); }
}

.spinner-face {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 3px solid var(--primary-cyan);
    background: rgba(0, 255, 255, 0.1);
    box-shadow: inset 0 0 30px rgba(0, 255, 255, 0.5);
}

.loading-text {
    color: var(--primary-cyan);
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Help Panel */
.help-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--primary-cyan);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 70vh;
    display: none;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 255, 255, 0.3);
    z-index: 2100;
}

.help-panel.active {
    display: flex;
}

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

.help-header h3 {
    color: var(--primary-cyan);
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.help-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-size: 1.2rem;
}

.help-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.help-section {
    margin-bottom: 2rem;
}

.help-section h4 {
    color: var(--primary-cyan);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.shortcuts-list, .help-list {
    list-style: none;
    padding: 0;
}

.shortcuts-list li, .help-list li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

kbd {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--primary-cyan);
}

.privacy-text {
    color: var(--text-secondary);
    line-height: 1.6;
    padding: 1rem;
    background: rgba(0, 255, 255, 0.05);
    border-left: 3px solid var(--accent-gold);
    border-radius: 4px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 100px;
    right: 2rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.toast {
    padding: 1rem 1.5rem;
    background: var(--panel-bg);
    backdrop-filter: blur(20px);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
    animation: slideIn var(--transition-smooth);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast.success {
    border-left: 4px solid var(--success-green);
}

.toast.error {
    border-left: 4px solid var(--error-red);
}

.toast.warning {
    border-left: 4px solid var(--warning-yellow);
}

.toast.info {
    border-left: 4px solid var(--primary-cyan);
}

.toast-icon {
    font-size: 1.5rem;
}

.toast-message {
    flex: 1;
    color: var(--text-primary);
}

.toast-close {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 1400px) {
    #forge-workspace {
        grid-template-columns: 1fr 2fr 1fr;
    }
}

@media (max-width: 1200px) {
    .main-title {
        font-size: 2rem;
    }
    
    .panel-column {
        min-width: 250px;
    }
}

@media (max-width: 992px) {
    #forge-workspace {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto 1fr;
    }
    
    .output-container {
        grid-column: 1 / -1;
        grid-row: 1;
    }
    
    .left-column {
        grid-column: 1;
        grid-row: 2;
    }
    
    .right-column {
        grid-column: 2;
        grid-row: 2;
    }
    
    .bottom-row {
        grid-column: 1 / -1;
        grid-row: 3;
    }
}

@media (max-width: 768px) {
    #main-header {
        flex-wrap: wrap;
        padding: 1rem;
    }
    
    .logo-container {
        flex: 1 0 100%;
        justify-content: center;
        margin-bottom: 1rem;
    }
    
    .header-controls {
        flex: 1;
        justify-content: center;
    }
    
    .privacy-badge {
        display: none;
    }
    
    #forge-workspace {
        grid-template-columns: 1fr;
        padding: 0.5rem;
    }
    
    .panel-column {
        min-width: 100%;
    }
    
    .code-panel {
        min-height: 150px;
    }
    
    .main-title {
        font-size: 1.5rem;
    }
    
    .cpt-cube {
        width: 40px;
        height: 40px;
    }
    
    .cube-face {
        width: 40px;
        height: 40px;
    }
}

/* Dark Theme Overrides */
body.dark-theme {
    --panel-bg: rgba(5, 5, 5, 0.95);
    --glass-bg: rgba(10, 10, 10, 0.8);
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    #main-header, #main-footer, .panel-controls, .editor-toolbar {
        display: none;
    }
    
    .code-panel {
        break-inside: avoid;
        page-break-inside: avoid;
        border: 1px solid #ccc;
        margin-bottom: 1rem;
    }
    
    .code-editor {
        background: white;
        color: black;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary-cyan: #00ffff;
        --text-primary: #ffffff;
        --panel-bg: rgba(0, 0, 0, 0.95);
        --glass-border: rgba(255, 255, 255, 0.5);
    }
}

/* Additional Animations */
@keyframes borderGlow {
    0% { border-color: var(--primary-cyan); }
    50% { border-color: var(--secondary-cyan); }
    100% { border-color: var(--primary-cyan); }
}

.code-panel:hover {
    animation: borderGlow 3s ease-in-out infinite;
}

/* Circuit Pattern Background */
#forge-workspace::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 50px,
            rgba(0, 255, 255, 0.03) 50px,
            rgba(0, 255, 255, 0.03) 51px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 50px,
            rgba(0, 255, 255, 0.03) 50px,
            rgba(0, 255, 255, 0.03) 51px
        );
    pointer-events: none;
    z-index: -1;
}

/* Glow Effects */
.btn-run::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: inherit;
    border-radius: inherit;
    opacity: 0;
    filter: blur(20px);
    transition: opacity var(--transition-smooth);
}

.btn-run:hover::after {
    opacity: 0.5;
}

/* Panel Drag Indicator */
.panel-header.dragging {
    cursor: grabbing;
    opacity: 0.8;
}

.code-panel.drag-over {
    border-color: var(--accent-gold);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

/* Focus Styles */
.code-editor:focus {
    box-shadow: inset 0 0 0 2px var(--primary-cyan);
}

button:focus-visible {
    outline: 2px solid var(--primary-cyan);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: var(--primary-cyan);
    color: var(--primary-black);
}

/* Final Polish */
.output-container {
    animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { box-shadow: 0 0 30px rgba(0, 255, 255, 0.3); }
    50% { box-shadow: 0 0 40px rgba(0, 255, 255, 0.5); }
}/* ============================================
   CPT OMNIFORGE - CSS MASK OVERLAY FIX
   PASTE THIS AT THE VERY BOTTOM OF YOUR CSS
   ============================================ */

/* OVERRIDE FIXES - Higher specificity to override existing */
body .code-panel.closed {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
    z-index: -9999 !important;
}

/* Fix minimize button functionality */
body .code-panel.minimized {
    min-height: auto !important;
    height: auto !important;
}

body .code-panel.minimized .panel-body {
    display: none !important;
    height: 0 !important;
    overflow: hidden !important;
}

body .code-panel.minimized .panel-header {
    border-radius: 12px !important;
    border-bottom: none !important;
}

/* Panel Manager Button - New Addition */
body .btn-panel-manager {
    background: var(--glass-bg) !important;
    color: var(--text-primary) !important;
    padding: 0.5rem 1rem !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 20px !important;
    font-size: 0.9rem !important;
    backdrop-filter: blur(10px) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    cursor: pointer !important;
    transition: all var(--transition-smooth) !important;
}

body .btn-panel-manager:hover {
    background: rgba(0, 255, 255, 0.1) !important;
    border-color: var(--primary-cyan) !important;
    box-shadow: var(--glow-shadow) !important;
    transform: translateY(-2px) !important;
}

/* Panel Manager Modal Styles */
body .panel-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    margin-bottom: 2rem !important;
}

body .panel-item {
    display: flex !important;
    align-items: center !important;
    gap: 1rem !important;
    padding: 0.75rem !important;
    background: rgba(0, 255, 255, 0.05) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 8px !important;
    transition: all var(--transition-fast) !important;
}

body .panel-item:hover {
    background: rgba(0, 255, 255, 0.1) !important;
    border-color: var(--primary-cyan) !important;
}

body .panel-status {
    font-size: 1.2rem !important;
    width: 30px !important;
    text-align: center !important;
    display: inline-block !important;
}

body .panel-item span:nth-child(2) {
    flex: 1 !important;
    font-weight: 500 !important;
    color: var(--text-primary) !important;
}

body .btn-toggle-panel {
    padding: 0.25rem 1rem !important;
    background: var(--glass-bg) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 4px !important;
    font-size: 0.85rem !important;
    cursor: pointer !important;
    transition: all var(--transition-fast) !important;
}

body .btn-toggle-panel:hover {
    background: rgba(0, 255, 255, 0.1) !important;
    border-color: var(--primary-cyan) !important;
    color: var(--primary-cyan) !important;
}

body .panel-actions {
    display: flex !important;
    gap: 1rem !important;
    justify-content: center !important;
    padding-top: 1rem !important;
    border-top: 1px solid var(--glass-border) !important;
}

body .btn-show-all, 
body .btn-hide-all, 
body .btn-reset-layout {
    padding: 0.5rem 1.5rem !important;
    background: var(--glass-bg) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all var(--transition-fast) !important;
    font-weight: 500 !important;
}

body .btn-show-all:hover, 
body .btn-hide-all:hover, 
body .btn-reset-layout:hover {
    background: rgba(0, 255, 255, 0.1) !important;
    border-color: var(--primary-cyan) !important;
    color: var(--primary-cyan) !important;
    transform: translateY(-1px) !important;
}

/* Visual feedback for closed panels in manager */
body .panel-item[data-panel] {
    position: relative !important;
    overflow: hidden !important;
}

body .panel-item[data-panel]::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0, 255, 255, 0.1) 50%, 
        transparent 100%) !important;
    transform: translateX(-100%) !important;
    transition: transform 0.6s ease !important;
    pointer-events: none !important;
}

body .panel-item[data-panel]:hover::before {
    transform: translateX(100%) !important;
}

/* Animation for panel show/hide */
@keyframes panelSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

body .code-panel:not(.closed) {
    animation: panelSlideIn 0.3s ease-out !important;
}

/* Ensure minimize/maximize/close buttons work properly */
body .btn-minimize,
body .btn-maximize,
body .btn-close {
    z-index: 10 !important;
    position: relative !important;
}

/* Fix for maximize state */
body .code-panel.maximized {
    position: fixed !important;
    top: 80px !important;
    left: 1rem !important;
    right: 1rem !important;
    bottom: 60px !important;
    z-index: 900 !important;
    max-width: none !important;
    max-height: none !important;
    width: auto !important;
    height: auto !important;
}

/* Ensure panel controls are always visible */
body .panel-controls {
    opacity: 0.7 !important;
    transition: opacity var(--transition-fast) !important;
}

body .panel-header:hover .panel-controls {
    opacity: 1 !important;
}

/* Toast notification for closed panels */
body .toast.info {
    border-left-color: var(--primary-cyan) !important;
    background: rgba(0, 255, 255, 0.1) !important;
}

/* END OF CSS MASK OVERLAY */