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

:root {
    --bg-primary: #1e1e1e;
    --bg-secondary: #252526;
    --bg-tertiary: #2d2d30;
    --bg-editor: #1e1e1e;
    --text-primary: #cccccc;
    --text-secondary: #858585;
    --border-color: #3e3e42;
    --accent-blue: #007acc;
    --accent-green: #4ec9b0;
    --accent-orange: #ce9178;
    --accent-red: #f48771;
    --accent-yellow: #dcdcaa;
    --header-height: 60px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* Header */
.header {
    height: var(--header-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--accent-blue);
}

.title {
    font-size: 1.4em;
    font-weight: 600;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Version selector */
.version-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.version-selector .version-label {
    color: var(--text-secondary);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.875rem;
    font-weight: 500;
}

.deck-version-dropdown {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 6px 10px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.875rem;
    cursor: pointer;
    outline: none;
    min-width: 140px;
    transition: all 0.2s;
}

.deck-version-dropdown:hover {
    border-color: var(--accent-blue);
    background: var(--bg-secondary);
}

.deck-version-dropdown:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 1px var(--accent-blue);
}

.deck-version-dropdown option {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 4px;
}

.deck-version {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.875rem;
}

.version-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.version-number {
    color: var(--accent-green);
    font-weight: 600;
}

.deck-version.error .version-number {
    color: var(--accent-red);
}

/* Deck links */
.deck-links {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
    margin-right: 20px;
}

.deck-link {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.813rem;
    font-weight: 500;
    transition: all 0.2s;
}

.deck-link:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.deck-link svg {
    width: 14px;
    height: 14px;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
}

.status-badge.ready .status-dot {
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
}

.status-badge.linting .status-dot {
    background: var(--accent-yellow);
    animation: pulse 1.5s ease-in-out infinite;
}

.status-badge.error .status-dot {
    background: var(--accent-red);
    box-shadow: 0 0 8px var(--accent-red);
}

.status-badge.success .status-dot {
    background: var(--accent-green);
    box-shadow: 0 0 8px var(--accent-green);
}

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

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

/* Main Content */
.main-content {
    display: flex;
    height: calc(100vh - var(--header-height));
    overflow: hidden;
}

/* Editor Section (Left) */
.editor-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.editor-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.editor-wrapper:first-child {
    flex: 1;
}

.editor-wrapper:last-child {
    flex: 1;
}

/* Resizer */
.resizer {
    background: var(--border-color);
    position: relative;
    z-index: 10;
}

.resizer:hover {
    background: var(--accent-blue);
}

.resizer.horizontal {
    width: 4px;
    cursor: ew-resize;
    flex-shrink: 0;
}

.resizer:not(.horizontal) {
    height: 4px;
    cursor: ns-resize;
    flex-shrink: 0;
}

.editor-header {
    height: 40px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
}

.editor-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.file-icon {
    font-size: 1.1rem;
}

.editor-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ruleset-dropdown {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.8rem;
    cursor: pointer;
    outline: none;
    max-width: 200px;
}

.ruleset-dropdown:hover {
    background: var(--bg-primary);
}

.ruleset-dropdown option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-icon {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}

.editor {
    flex: 1;
    min-height: 0;
}

/* Output Section (Right) */
.output-section {
    flex: 0 0 600px;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

.output-header {
    height: 40px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
}

.output-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.result-stats {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.output-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-primary);
}

.output-content::-webkit-scrollbar {
    width: 10px;
}

.output-content::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.output-content::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 5px;
}

.output-content::-webkit-scrollbar-thumb:hover {
    background: var(--border-color);
}

/* Output States */
.output-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    font-style: italic;
}

.output-success {
    color: var(--accent-green);
}

.output-error {
    color: var(--accent-red);
}

.output-line {
    margin-bottom: 4px;
    white-space: pre-wrap;
    word-wrap: break-word;
    padding: 2px 0;
    line-height: 1.8;
}

.output-line.error-line {
    color: var(--accent-red);
    font-weight: 500;
}

.output-line.warning-line {
    color: var(--accent-yellow);
}

.output-line.info-line {
    color: var(--accent-blue);
}

.output-line.success-line {
    color: var(--accent-green);
    font-weight: 500;
}

.output-line.ascii-art {
    font-family: 'Courier New', 'Courier', monospace;
    font-size: 12px;
    line-height: 1.2;
    color: var(--accent-green);
    font-weight: 400;
    white-space: pre;
}

.output-line.rule-line {
    color: var(--accent-orange);
    font-weight: 500;
}

.output-line.comment-line {
    color: var(--text-secondary);
    font-style: italic;
}

.output-line.position-line {
    color: var(--text-primary);
}

.output-line.empty-line {
    min-height: 1em;
}

/* Severity badges */
.severity-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 4px;
}

.error-badge {
    background: rgba(244, 135, 113, 0.2);
    color: var(--accent-red);
    border: 1px solid var(--accent-red);
}

.warn-badge {
    background: rgba(220, 220, 170, 0.2);
    color: var(--accent-yellow);
    border: 1px solid var(--accent-yellow);
}

.info-badge {
    background: rgba(0, 122, 204, 0.2);
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
}

/* Line and column numbers */
.line-col {
    color: var(--accent-blue);
    font-weight: 600;
    background: rgba(0, 122, 204, 0.1);
    padding: 1px 4px;
    border-radius: 2px;
}

/* Rule names */
.rule-name {
    color: var(--accent-orange);
    font-weight: 600;
}

/* Stats styling */
.result-stats {
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: flex;
    gap: 8px;
}

.stat-error {
    color: var(--accent-red);
    font-weight: 600;
}

.stat-warning {
    color: var(--accent-yellow);
    font-weight: 600;
}

.stat-info {
    color: var(--accent-blue);
    font-weight: 600;
}

.stat-success {
    color: var(--accent-green);
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1200px) {
    .output-section {
        flex: 0 0 400px;
    }
}

@media (max-width: 900px) {
    .main-content {
        flex-direction: column;
    }

    .editor-section {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        height: 50%;
    }

    .output-section {
        flex: 1;
        height: 50%;
    }

    .editor-wrapper:first-child {
        border-bottom: 1px solid var(--border-color);
    }
}

@media (max-width: 600px) {
    .header {
        padding: 0 12px;
    }

    .title {
        font-size: 1.1em;
    }

    .logo-icon {
        width: 24px;
        height: 24px;
    }
}

.logo-icon {
  object-fit: contain;
  display: block;
}