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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-feature-settings: "cv11", "ss01";
    font-variant-numeric: tabular-nums;
    background-color: #f9fafb;
    color: #1f2937;
    line-height: 1.6;
}

.font-mono {
    font-family: 'JetBrains Mono', 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

/* Container */
.container {
    min-height: 100vh;
    padding: 1rem;
    max-width: 1536px;
    margin: 0 auto;
}

/* Header */
.header {
    margin-bottom: 2rem;
}

.navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background-color: white;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.nav-btn:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

.nav-icon {
    font-size: 1rem;
}

.header-content {
    text-align: center;
}

.header h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1f2937;
}

.subtitle {
    color: #6b7280;
    font-size: 1rem;
}

/* Fixed Control Panel */
.control-panel {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 50;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    padding: 1rem;
}

.control-panel-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 1rem;
}

.status-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background-color: #ef4444;
}

.status-dot.running {
    background-color: #10b981;
    animation: pulse 2s infinite;
}

.status-dot.paused {
    background-color: #f59e0b;
}

.status-text {
    font-size: 0.875rem;
    font-weight: 500;
}

.control-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-description {
    color: #6b7280;
    font-size: 0.875rem;
}

.card-content {
    padding: 1.5rem;
}

/* Input Form */
.input-sections {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.input-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.input-container {
    position: relative;
}

.input-field {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 3rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-field:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-field:disabled {
    background-color: #f9fafb;
    color: #6b7280;
    cursor: not-allowed;
}

.input-label {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.875rem;
    color: #6b7280;
    font-family: 'JetBrains Mono', monospace;
}

.separator {
    height: 1px;
    background-color: #e5e7eb;
    margin: 1.5rem 0;
}

.control-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #1f2937;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #111827;
}

.btn-outline {
    background-color: white;
    border-color: #d1d5db;
    color: #374151;
}

.btn-outline:hover:not(:disabled) {
    background-color: #f9fafb;
}

.btn-destructive {
    background-color: #dc2626;
    color: white;
}

.btn-destructive:hover:not(:disabled) {
    background-color: #b91c1c;
}

.btn-large {
    padding: 1rem 1.5rem;
    font-size: 1.125rem;
}

.btn-icon {
    font-size: 1rem;
}

/* Help Text */
.help-text {
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: #92400e;
}

/* Code Display */
.code-container {
    background-color: #fef7ed;
    border-radius: 0.5rem;
    padding: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    font-weight: 700;
    color: #000;
    overflow-x: auto;
}

.code-line {
    padding: 0.25rem 0.5rem;
    margin: 0.125rem 0;
    border-radius: 0.25rem;
    white-space: nowrap;
    transition: all 0.3s;
}

.code-line.highlighted {
    background-color: #fbbf24;
    color: #000;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Variables Display */
.variables-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(to right, #dbeafe, #e0e7ff);
    border: 1px solid #3b82f6;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.variable-box {
    text-align: center;
}

.variable-label {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.variable-value {
    font-size: 1.25rem;
    font-family: 'JetBrains Mono', monospace;
    background-color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid #d1d5db;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* Execution Section */
.execution-section {
    margin-bottom: 1rem;
}

.current-step {
    background-color: #f9fafb;
    padding: 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid #e5e7eb;
    margin-bottom: 0.75rem;
}

.step-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.step-description {
    font-size: 0.875rem;
    font-family: 'JetBrains Mono', monospace;
    background-color: white;
    padding: 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid #e5e7eb;
}

.progress-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #6b7280;
}

.progress-bar {
    width: 5rem;
    height: 0.5rem;
    background-color: #e5e7eb;
    border-radius: 0.25rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #3b82f6;
    border-radius: 0.25rem;
    transition: width 0.3s;
    width: 0%;
}

/* Result Section */
.result-section {
    padding: 1rem;
    background: linear-gradient(to right, #d1fae5, #a7f3d0);
    border: 1px solid #10b981;
    border-radius: 0.5rem;
}

.result-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #065f46;
    margin-bottom: 0.75rem;
}

.result-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.result-item span:first-child {
    color: #047857;
    font-size: 0.875rem;
}

.result-value {
    font-family: 'JetBrains Mono', monospace;
    background-color: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid #d1d5db;
    font-size: 0.875rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

/* Utility Classes */
.hidden {
    display: none;
}

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

/* Responsive Design */
@media (min-width: 640px) {
    .container {
        padding: 1.5rem;
    }
    
    .header-content {
        text-align: left;
    }
    
    .header h1 {
        font-size: 2.5rem;
    }
    
    .input-sections {
        grid-template-columns: 1fr 1fr;
    }
    
    .control-section {
        flex-direction: row;
    }
    
    .control-section .btn:first-child {
        flex: 1;
    }
    
    .control-section .btn:last-child {
        flex: initial;
    }
}

@media (min-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    
    .input-card {
        grid-row: 1;
    }
    
    .code-card {
        grid-row: 1;
    }
    
    .variables-card {
        grid-column: 1 / -1;
    }
}

@media (min-width: 1280px) {
    .main-content {
        grid-template-columns: 1fr 1fr 1fr;
    }
    
    .input-card {
        grid-column: 1;
    }
    
    .code-card {
        grid-column: 2;
    }
    
    .variables-card {
        grid-column: 3;
    }
}