:root {
    --primary-color: #0056b3;
    --secondary-color: #007bff;
    --bg-color: #f8f9fa;
    --card-bg-color: #ffffff;
    --text-color: #343a40;
    --light-text-color: #6c757d;
    --border-radius: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body { font-family: 'Poppins', sans-serif; background-color: var(--bg-color); color: var(--text-color); line-height: 1.6; }

.page-header { max-width: 700px; margin: 0 auto; padding: 1.5rem 2rem 0; }
.btn-back { display: inline-block; padding: 0.5rem 1rem; background-color: #e9ecef; color: var(--primary-color); text-decoration: none; border-radius: var(--border-radius); font-weight: 600; transition: background-color 0.3s ease; }
.btn-back:hover { background-color: #dee2e6; }

.container { max-width: 700px; margin: 1rem auto 2rem; padding: 2.5rem; background-color: var(--card-bg-color); border-radius: var(--border-radius); box-shadow: var(--shadow); border: 1px solid #e9ecef; }
.calculator-header { text-align: center; margin-bottom: 2rem; }
.calculator-header h1 { color: var(--primary-color); margin-bottom: 0.5rem; }

.category-selector {
    text-align: center;
    margin-bottom: 2rem;
}
.category-selector label {
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
}
.category-selector select {
    width: 100%;
    max-width: 400px;
    padding: 0.75rem;
    font-size: 1.1rem;
    font-family: 'Poppins', sans-serif;
    border-radius: var(--border-radius);
    border: 1px solid #ced4da;
}

.converter-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.input-wrapper, .output-wrapper {
    flex: 1;
    min-width: 250px;
}

.input-wrapper input, .input-wrapper select, 
.output-wrapper select {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #ced4da;
    border-radius: var(--border-radius);
    font-family: 'Poppins', sans-serif;
}
.input-wrapper input {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.input-wrapper input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.equals-symbol {
    font-size: 2rem;
    font-weight: 700;
    color: var(--light-text-color);
}

#output-value {
    width: 100%;
    padding: 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: var(--border-radius);
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    word-break: break-all;
}


.explanation-article { max-width: 700px; margin: 0 auto 2rem; padding: 2.5rem; background-color: var(--card-bg-color); border-radius: var(--border-radius); box-shadow: var(--shadow); border: 1px solid #e9ecef; }
.explanation-article h2, .explanation-article h3 { color: var(--primary-color); margin-bottom: 1rem; }
.explanation-article h3 { margin-top: 1.5rem; border-bottom: 1px solid #eee; padding-bottom: 0.5rem; font-size: 1.3rem; }
.explanation-article p { margin-bottom: 1rem; }

.main-footer { text-align: center; padding: 2rem 1rem; color: var(--light-text-color); font-size: 0.9rem; }

@media (max-width: 768px) {
    .container, .page-header, .explanation-article { margin-left: 1rem; margin-right: 1rem; padding: 1.5rem; }
    .converter-row { flex-direction: column; }
}