:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.container {
    width: 98%;
    max-width: 1500px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    margin: 20px;
}

h1 {
    margin: 0;
    font-size: 1.5rem;
    text-align: center;
}

.description {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.main-layout {
    display: grid;
    grid-template-columns: 240px 1fr 240px;
    gap: 20px;
    height: calc(100vh - 200px);
    min-height: 600px;
}

.editor-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
}

.panels-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    flex: 1;
    min-height: 0;
}

.panel-box {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.panel-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.textarea-wrapper {
    position: relative;
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
}

textarea,
.highlight-layer,
.result-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 20px;
    font-size: 1.1rem;
    line-height: 1.6;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
    border: none;
    background: transparent;
    color: var(--text-main);
    white-space: pre-wrap;
    word-wrap: break-word;
    margin: 0;
    outline: none;
    overflow-y: auto;
}

textarea {
    z-index: 2;
    resize: none;
    color: var(--text-main);
    caret-color: white;
}

/* Orijinal metin üzerindeki highlight katmanı */
.highlight-layer {
    z-index: 1;
    color: transparent;
    /* Yazıyı gizle, sadece arka plan kalsın */
    pointer-events: none;
}

.result-layer {
    background: rgba(255, 255, 255, 0.02);
    cursor: default;
}

/* Highlight stili: Bold ve vurgulu */
.highlight-mark {
    background-color: rgba(245, 158, 11, 0.4);
    border-bottom: 2px solid #f59e0b;
    font-weight: 700;
    color: transparent;
    display: inline;
}

.sidebar {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px;
    height: 100%;
    overflow-y: auto;
}

.sidebar h3 {
    margin: 0 0 16px 0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.history-sidebar h3 {
    color: #10b981;
}

.rules-sidebar h3 {
    color: #818cf8;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar li {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 8px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}

.history-sidebar li {
    font-family: 'JetBrains Mono', monospace;
    padding: 6px 10px;
}

.change-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.old {
    color: #ef4444;
    font-size: 0.75rem;
}

.new {
    color: #10b981;
    font-weight: 600;
    font-size: 0.8rem;
}

.dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
    margin-right: 8px;
}

.actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

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

button.secondary {
    background: rgba(255, 255, 255, 0.1);
}

.stats {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.badge {
    background: rgba(99, 102, 241, 0.1);
    color: #818cf8;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}