:root {
    --primary-color: #3498db;
    --primary-dark: #2980b9;
    --secondary-color: #2c3e50;
    --light-color: #f5f7fa;
    --white: #ffffff;
    --success-color: #27ae60;
    --error-color: #e74c3c;
    --warning-color: #f39c12;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--secondary-color);
    background-color: var(--light-color);
    padding: 0;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    text-align: center;
}

.justified-text {
    text-align: justify;
    text-justify: inter-word;
}

.note {
    margin-top: 1em;
    font-style: italic;
    font-size: 0.9rem;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.1rem;
    text-align: justify;
}

.form-card {
    background-color: var(--white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 30px;
}

.form-section {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.form-section h2 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--light-color);
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--secondary-color);
}

input[type="number"],
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
}

input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Radio button styles */
.alkali-radio-group,
.additive-radio-group {
    margin-bottom: 20px;
}

.radio-options {
    display: flex;
    gap: 15px;
    margin-top: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    margin-right: 5px;
}

.radio-option span {
    padding: 8px 12px;
    border-radius: 4px;
    transition: var(--transition);
}

.radio-option input[type="radio"]:checked + span {
    background-color: var(--primary-color);
    color: white;
}

.alkali-input-group {
    margin-top: 15px;
    padding: 15px;
    background-color: rgba(52, 152, 219, 0.05);
    border-radius: var(--border-radius);
    border-left: 3px solid var(--primary-color);
}


.additive-radio-group {
    margin-bottom: 15px;
}

.additive-input-group {
    margin-top: 15px;
    padding: 15px;
    background-color: rgba(52, 152, 219, 0.05);
    border-radius: var(--border-radius);
    border-left: 3px solid var(--primary-color);
}

.form-actions {
    text-align: center;
    margin-top: 30px;
}

button[type="submit"] {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    max-width: 300px;
}

button[type="submit"]:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.result-card {
    background-color: var(--white);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
    font-size: 1.1rem;
    color: var(--secondary-color);
    border-left: 4px solid var(--primary-color);
}


.result-card p {
    margin: 0;
}

.credits {
    margin-top: 10px;
    padding: 10px;
    text-align: center;
    font-size: 1.2rem;
    color: #555;
    background-color: #f5f7fa; /* Light gray background */
    border-radius: 8px;
}

.credits p {
    margin: 8px 0;
}


/* Add to your existing CSS */
.warning-message {
    color: var(--error-color);
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
}

.input-valid {
    border-color: var(--success-color) !important;
}

.input-invalid {
    border-color: var(--error-color) !important;
}

.result-valid {
    color: var(--success-color);
    border-left-color: var(--success-color);
}

.result-invalid {
    color: var(--error-color);
    border-left-color: var(--error-color);
}

.recommended-input {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-bottom: 5px;
}


/*New updated*/
.error-message {
    background-color: #ffebee;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-left: 3px solid var(--error-color);
}

.error-message p {
    margin: 5px 0;
    color: var(--error-color);
}

hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 15px 0;
}

/* Loading State */
button[type="submit"][disabled] {
    background-color: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
 

/* Responsive Design */
@media (min-width: 768px) {
    .form-card {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 25px;
    }
    
    .form-section {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }
    
    .form-actions {
        grid-column: 1 / span 2;
    }
}

/* Special Styling for Chemical Formulas */
.chemical-formula {
    font-style: italic;
    color: #7f8c8d;
    font-weight: normal;
}

/* Status colors */
.success {
    color: var(--success-color);
    border-left-color: var(--success-color);
}

.error {
    color: var(--error-color);
    border-left-color: var(--error-color);
}

.warning {
    color: var(--warning-color);
    border-left-color: var(--warning-color);
}

.loading {
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}
