:root {
    --primary: #6366F1;
    --primary-hover: #4F46E5;
    --secondary: #818CF8;
    --accent: #A5B4FC;
    --bg-main: #0F172A;
    --bg-panel: rgba(30, 41, 59, 0.7);
    --bg-panel-solid: #1E293B;
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --border-color: rgba(255, 255, 255, 0.1);

    --error: #EF4444;
    --error-bg: rgba(239, 68, 68, 0.1);
    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --info: #3B82F6;
    --info-bg: rgba(59, 130, 246, 0.1);
    --success: #10B981;

    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;

    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.glass-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background:
        radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(129, 140, 248, 0.1), transparent 25%);
    z-index: -1;
}

.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
}

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

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-radius: var(--radius-lg);
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    background: linear-gradient(to right, #fff, var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

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

/* Editor Section */
.editor-section,
.results-section {
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    backdrop-filter: blur(12px);
}

.editor-header,
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.editor-header h2,
.results-header h2 {
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.editor-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    position: relative;
}

.line-numbers {
    padding: 1rem 0.5rem;
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-secondary);
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    text-align: right;
    user-select: none;
    line-height: 1.5;
    border-right: 1px solid var(--border-color);
    min-width: 3rem;
    overflow-y: hidden;
}

textarea,
#fixedCodeOutput {
    flex: 1;
    background: transparent;
    color: var(--text-primary);
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    padding: 1rem;
    border: none;
    resize: none;
    outline: none;
    white-space: pre;
    overflow: auto;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-panel-solid);
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Results Section */
.results-container {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-secondary);
    gap: 1rem;
    text-align: center;
}

.empty-state i {
    font-size: 3rem;
    opacity: 0.5;
}

.stats {
    display: flex;
    gap: 0.75rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.badge.error {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge.warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge.info {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

/* Lint Items */
.lint-item {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    overflow: hidden;
    animation: slideIn 0.3s ease forwards;
    opacity: 0;
    transform: translateY(10px);
}

.lint-item:nth-child(1) {
    animation-delay: 0.05s;
}

.lint-item:nth-child(2) {
    animation-delay: 0.10s;
}

.lint-item:nth-child(3) {
    animation-delay: 0.15s;
}

.lint-item:nth-child(4) {
    animation-delay: 0.20s;
}

.lint-item:nth-child(5) {
    animation-delay: 0.25s;
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lint-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-left: 4px solid transparent;
}

.lint-item.error .lint-header {
    border-left-color: var(--error);
    background: linear-gradient(to right, var(--error-bg), transparent);
}

.lint-item.warning .lint-header {
    border-left-color: var(--warning);
    background: linear-gradient(to right, var(--warning-bg), transparent);
}

.lint-item.info .lint-header {
    border-left-color: var(--info);
    background: linear-gradient(to right, var(--info-bg), transparent);
}

.lint-icon {
    font-size: 1.25rem;
}

.lint-item.error .lint-icon {
    color: var(--error);
}

.lint-item.warning .lint-icon {
    color: var(--warning);
}

.lint-item.info .lint-icon {
    color: var(--info);
}

.lint-content {
    flex: 1;
}

.lint-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lint-rule-id {
    font-size: 0.75rem;
    padding: 0.1rem 0.4rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    color: var(--text-secondary);
}

.lint-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.lint-line {
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.4);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    display: flex;
    gap: 1rem;
}

.lint-line-num {
    color: var(--text-secondary);
    user-select: none;
}

/* Fixed Code Section */
.fixed-code-section {
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.5);
    flex: 0 0 40%;
    display: flex;
    flex-direction: column;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rule-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.rule-info h4 {
    margin-bottom: 0.25rem;
}

.rule-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border-radius: 24px;
    border: 1px solid var(--border-color);
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background-color: var(--text-secondary);
    transition: .3s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--primary);
    border-color: var(--primary);
}

input:checked+.slider:before {
    transform: translateX(20px);
    background-color: white;
}

@media (max-width: 1024px) {
    main {
        grid-template-columns: 1fr;
    }

    .container {
        height: auto;
        min-height: 100vh;
    }
}