/* Reset dasar dan font global */
:root {
    --primary-color: #6a5acd; /* SlateBlue */
    --primary-light: #e9e6ff;
    --secondary-color: #2ecc71; /* Green */
    --error-color: #e74c3c; /* Red */
    --text-dark: #2c3e50;
    --text-light: #7f8c8d;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --border-color: #dfe6e9;
}

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

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 2rem;
}

.container {
    width: 100%;
    max-width: 900px;
    background-color: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    padding: 2rem 3rem;
}

header { text-align: center; margin-bottom: 2rem; }
header h1 { font-size: 2.8rem; color: var(--text-dark); }
.subtitle { font-size: 1.1rem; color: var(--text-light); }
.section-title { font-size: 1.8rem; margin: 2.5rem 0 1.5rem 0; text-align: center; }

/* Input Card */
.input-card { display: flex; flex-direction: column; gap: 1rem; }
textarea {
    width: 100%; min-height: 160px; padding: 1rem; border-radius: 12px;
    border: 1px solid var(--border-color); font-family: 'Poppins', sans-serif;
    font-size: 1rem; resize: vertical; transition: all 0.3s;
}
textarea:focus {
    outline: none; border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-light);
}
#analyze-btn {
    padding: 1rem; border: none; background: var(--primary-color);
    color: white; font-size: 1.1rem; font-weight: 600;
    border-radius: 12px; cursor: pointer; transition: all 0.3s;
}
#analyze-btn:hover { background-color: #5a4ab9; transform: translateY(-2px); }

/* Skor Grid */
.scores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}
.score-item {
    background-color: #fdfdff;
    border: 1px solid var(--border-color);
    border-radius: 12px; padding: 1.5rem 1rem;
    text-align: center; transition: all 0.3s;
}
.score-item:hover { transform: translateY(-5px); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.score-circle {
    width: 120px; height: 120px; margin: 0 auto 1rem;
    border-radius: 50%; display: grid; place-items: center;
    background: conic-gradient(var(--primary-color) 0deg, #e0e0e0 0deg);
    position: relative;
}
.score-circle::before {
    content: ''; position: absolute;
    width: 100px; height: 100px;
    background: var(--card-bg); border-radius: 50%;
}
.score-value { font-size: 2.2rem; font-weight: 700; z-index: 1; }
.score-name { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.25rem; }
.score-desc { font-size: 0.8rem; color: var(--text-light); }

/* Perbandingan Teks */
.comparison-card {
    display: grid; grid-template-columns: 1fr; gap: 1.5rem;
}
@media (min-width: 768px) { .comparison-card { grid-template-columns: 1fr 1fr; } }
.text-box { padding: 1.5rem; border-radius: 12px; }
.text-box.original { background-color: #fff4f4; border: 1px solid #ffe0e0; }
.text-box.corrected { background-color: #f2fff8; border: 1px solid #d4f8e3; }
.text-box h3 { margin-bottom: 0.5rem; }
.text-box p { line-height: 1.7; }

/* Detail Kesalahan */
.errors-list { display: flex; flex-direction: column; gap: 1rem; }
.error-item {
    display: flex; flex-direction: column; gap: 0.5rem;
    padding: 1rem; border: 1px solid var(--border-color);
    border-radius: 12px; background-color: #fdfdff;
}
@media (min-width: 768px) { .error-item { flex-direction: row; align-items: center; } }
.error-message-text { flex-grow: 1; }
.error-suggestion { font-weight: 600; color: var(--secondary-color); margin: 0 1rem; }
.error-category {
    background-color: var(--primary-light); color: var(--primary-color);
    padding: 0.25rem 0.75rem; border-radius: 20px;
    font-size: 0.8rem; font-weight: 600; text-transform: uppercase;
    white-space: nowrap;
}

/* Loader dan Error Box */
.loader {
    width: 60px; height: 60px; border: 6px solid #f3f3f3;
    border-top: 6px solid var(--primary-color); border-radius: 50%;
    animation: spin 1.2s linear infinite; margin: 3rem auto;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.error-box {
    margin-top: 2rem; padding: 1rem; background-color: #ffebeb;
    color: var(--error-color); border: 1px solid var(--error-color);
    border-radius: 12px; text-align: center;
}

footer { text-align: center; margin-top: 3rem; color: var(--text-light); font-size: 0.9rem; }