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

:root {
    --primary-color: #3498db;
    --primary-hover: #2980b9;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --border-color: #dfe6e9;
    --text-color: #2d3436;
    --text-muted: #636e72;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.15);
}

[data-theme="dark"] {
    --primary-color: #3498db;
    --primary-hover: #5dade2;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --bg-color: #1a1a1a;
    --card-bg: #2d2d2d;
    --border-color: #404040;
    --text-color: #e0e0e0;
    --text-muted: #a0a0a0;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.5);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

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

header {
    background-color: var(--card-bg);
    padding: 1.5rem 2rem;
    box-shadow: var(--shadow);
    z-index: 10;
}

header h1 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.stats-bar {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.stat-value {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color);
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.sidebar {
    width: 300px;
    background-color: var(--card-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.search-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.875rem;
    background-color: var(--card-bg);
    color: var(--text-color);
    transition: border-color 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.mod-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.mod-item {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

[data-theme="light"] .mod-item:hover {
    background-color: #e8f4f8;
    border-color: var(--primary-color);
}

[data-theme="dark"] .mod-item:hover {
    background-color: #1e3a4f;
    border-color: var(--primary-color);
}

.mod-item.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.mod-item.active .mod-stats {
    color: rgba(255, 255, 255, 0.9);
}

.mod-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.mod-stats {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.75rem;
}

.badge {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-weight: 600;
    font-size: 0.75rem;
}

.badge-warning {
    background-color: var(--warning-color);
    color: white;
}

.badge-success {
    background-color: var(--success-color);
    color: white;
}

.editor-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-header {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.editor-title h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.editor-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.filter-select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.875rem;
    background-color: var(--card-bg);
    color: var(--text-color);
    cursor: pointer;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
}

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

.editor-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.welcome-message {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.welcome-message h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.translation-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: box-shadow 0.2s;
}

.translation-item:hover {
    box-shadow: var(--shadow-hover);
}

.translation-item.modified {
    border-color: var(--warning-color);
}

[data-theme="light"] .translation-item.modified {
    background-color: #fffbf0;
}

[data-theme="dark"] .translation-item.modified {
    background-color: #3a3520;
}

.translation-key {
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    word-break: break-all;
}

.translation-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.translation-field {
    display: flex;
    flex-direction: column;
}

.translation-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.translation-value {
    padding: 0.75rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.875rem;
    line-height: 1.5;
    min-height: 3rem;
}

.translation-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.875rem;
    font-family: inherit;
    resize: vertical;
    min-height: 3rem;
    transition: border-color 0.2s;
}

.translation-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    box-shadow: var(--shadow);
    font-weight: 600;
    opacity: 0;
    transform: translateY(-1rem);
    transition: all 0.3s;
    pointer-events: none;
    z-index: 1000;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification.success {
    background-color: var(--success-color);
    color: white;
}

.notification.error {
    background-color: var(--danger-color);
    color: white;
}

.theme-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    z-index: 999;
    font-size: 1.25rem;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-hover);
}

.translation-input {
    background-color: var(--card-bg);
    color: var(--text-color);
}

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

    .sidebar {
        width: 100%;
        max-height: 300px;
    }

    .translation-content {
        grid-template-columns: 1fr;
    }
}
