:root {
    --primary: #22C55E;
    --primary-hover: #16a34a;
    --bg-dark: #0A1A0F;
    --bg-panel: rgba(18, 38, 25, 0.7);
    --bg-panel-border: rgba(34, 197, 94, 0.2);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --warning: #f59e0b;
    --highlight: rgba(34, 197, 94, 0.15);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.5;
    min-height: 100vh;
    background-image: radial-gradient(circle at 50% 0%, rgba(34, 197, 94, 0.1) 0%, transparent 50%);
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    height: 100vh;
}

header {
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #4ade80, #22c55e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
}

main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    flex: 1;
    min-height: 0;
}

@media (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
        height: auto;
    }
    .app-container {
        height: auto;
    }
}

.editor-section, .results-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--bg-panel);
    backdrop-filter: blur(10px);
    border: 1px solid var(--bg-panel-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.editor-container {
    flex: 1;
    min-height: 300px;
    display: flex;
}

textarea {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 1rem;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    resize: none;
    transition: border-color 0.2s ease;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
}

select {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    cursor: pointer;
    outline: none;
}

button {
    cursor: pointer;
    font-family: var(--font-sans);
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
}

.primary-btn {
    background: var(--primary);
    color: #000;
    padding: 1rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
}

.secondary-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
}

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

.explanation-container {
    flex: 1;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.explanation-container.empty {
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
}

.explanation-line {
    background: rgba(255, 255, 255, 0.03);
    border-left: 3px solid var(--primary);
    padding: 1rem;
    border-radius: var(--radius-sm);
    animation: fadeIn 0.3s ease;
}

.explanation-line.danger {
    border-left-color: var(--danger);
    background: var(--danger-bg);
}

.explanation-line.warning {
    border-left-color: var(--warning);
}

.line-code {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    word-break: break-all;
}

.line-desc {
    font-size: 0.95rem;
}

.detail-tag {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    margin-right: 0.4rem;
    margin-top: 0.4rem;
}

.detail-pipe { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.detail-var { background: rgba(168, 85, 247, 0.2); color: #d8b4fe; }
.detail-redirect { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }

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

/* Scrollbar styles */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }
