:root {
    --primary: #2563EB;
    --primary-hover: #1D4ED8;
    --bg-start: #DBEAFE;
    --bg-end: #1E3A8A;
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-main: #1E293B;
    --text-muted: #475569;
    --border: #E2E8F0;
    --success: #10B981;
    --danger: #EF4444;
    --radius: 16px;
    
    /* Lauder Scale Colors */
    --lvl-1: #10B981; /* Tidak ada beda */
    --lvl-2: #3B82F6; /* Beda wicara */
    --lvl-3: #F59E0B; /* Beda subdialek */
    --lvl-4: #EF4444; /* Beda dialek */
    --lvl-5: #8B5CF6; /* Beda bahasa */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(135deg, var(--bg-start) 0%, var(--bg-end) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-main);
    line-height: 1.6;
    padding: 2rem;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 0rem;
}

.header h1 {
    font-size: 2.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    margin-bottom: 0.5rem;
}

.header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #F9FAFB;
}

.upload-area:hover {
    border-color: var(--primary);
    background: #EEF2FF;
}

.btn {
    background: var(--primary);
    color: #f0f0f0;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 1rem;
}

.btn:hover {
    background: var(--primary-hover);
    color: white;
}

.file-input {
    margin-top: 1rem;
    font-size: 1rem;
}

.error {
    background: #FEE2E2;
    color: #991B1B;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    border: 1px solid #F87171;
}

/* Results Table */
.results-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    text-align: left;
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

th {
    background: #F9FAFB;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

td {
    font-size: 0.8rem;
}

tr:hover {
    background: #F9FAFB;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    white-space: nowrap;
}

.level-1 { background-color: var(--lvl-1); }
.level-2 { background-color: var(--lvl-2); }
.level-3 { background-color: var(--lvl-3); }
.level-4 { background-color: var(--lvl-4); }
.level-5 { background-color: var(--lvl-5); }

.scale-info {
    margin-bottom: 2rem;
}

.scale-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.scale-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-top: 4px solid var(--primary);
}

.scale-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.scale-card .value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background-color: #fefefe;
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    display: block;
    text-align: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}

.lev-op-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    margin: 2px;
    transition: transform 0.15s ease;
}
.lev-op-badge:hover { transform: scale(1.15); }
.lev-op-match { background: #D1FAE5; color: #065F46; border: 1px solid #6EE7B7; }
.lev-op-substitute { background: #FEF3C7; color: #92400E; border: 1px solid #FCD34D; }
.lev-op-insert { background: #DBEAFE; color: #1E40AF; border: 1px solid #93C5FD; }
.lev-op-delete { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }
.lev-summary-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.lev-summary-item {
    text-align: center;
    padding: 0.6rem 0.4rem;
    border-radius: 8px;
    font-size: 0.85rem;
}
.lev-summary-item .lev-num {
    font-size: 1.4rem;
    font-weight: 700;
    display: block;
}
.lev-btn {
    background: linear-gradient(135deg, #6366F1, #8B5CF6);
    color: white;
    border: none;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}
.lev-btn:hover {
    background: linear-gradient(135deg, #4F46E5, #7C3AED);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    body { padding: 1rem; }
    .header h1 { font-size: 2rem; }
}
