:root {
    --primary: #E17055;
    --primary-hover: #d15f44;
    --secondary: #FAB1A0;
    --accent: #0984E3;
    --bg-dark: #1A0F0A;
    --bg-panel: rgba(45, 25, 18, 0.7);
    --bg-panel-border: rgba(225, 112, 85, 0.2);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --danger: #ff7675;
    --success: #55efc4;
    --match-bg: rgba(225, 112, 85, 0.3);
    --match-border: #E17055;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --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(225, 112, 85, 0.08) 0%, transparent 60%);
}

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

header {
    text-align: center;
}

header h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--primary);
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

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

main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex: 1;
    min-height: 0;
}

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

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

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

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

.panel-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.actions {
    display: flex;
    gap: 0.5rem;
}

.code-container {
    flex: 1;
    position: relative;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.code-editor {
    width: 100%;
    height: 100%;
    background: transparent;
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    padding: 1rem;
    border: none;
    resize: none;
    outline: none;
    line-height: 1.5;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    caret-color: var(--primary);
}

.code-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.5;
    color: transparent;
    pointer-events: none;
    z-index: 1;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-y: auto;
}

.highlight-match {
    background-color: var(--match-bg);
    border-radius: 2px;
    border-bottom: 2px solid var(--match-border);
}

.status-bar {
    font-size: 0.85rem;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.status-bar.valid {
    color: var(--success);
    background: rgba(85, 239, 196, 0.1);
}

.status-bar.invalid {
    color: var(--danger);
    background: var(--danger-bg);
}

.results-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(10px);
    border: 1px solid var(--bg-panel-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    min-height: 250px;
}

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

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

.result-item {
    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;
}

.result-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: var(--secondary);
}

.result-msg {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.result-code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.75rem;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    white-space: pre-wrap;
}

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

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

.primary-btn {
    background: var(--primary);
    color: #000;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
}

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

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

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

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

::-webkit-scrollbar { width: 8px; height: 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); }
