/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
    background: #f0f4f8;
    color: #1a202c;
    line-height: 1.6;
    padding: 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, #2b6cb0, #2c5282);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
}

header p {
    opacity: 0.9;
    font-size: 1.1rem;
}

.back-link {
    color: #bee3f8;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 15px;
    font-weight: 500;
}

.back-link:hover {
    color: white;
    text-decoration: underline;
}

/* Calculator Grid (index.php) */
.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.calc-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.calc-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.calc-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.calc-card h3 {
    color: #2b6cb0;
    margin-bottom: 8px;
    font-size: 1.2rem;
}

.calc-card p {
    color: #4a5568;
    font-size: 0.95rem;
    flex-grow: 1;
    margin-bottom: 12px;
}

.calc-meta {
    color: #718096;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #2b6cb0;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.btn:hover {
    background: #1a4f8b;
}

.btn-primary {
    background: #2b6cb0;
    color: white;
}

.btn-primary:hover {
    background: #1a4f8b;
}

.btn-secondary {
    background: #e2e8f0;
    color: #2d3748;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

/* Calculator Form (calculator.php) */
.calculator-container {
    max-width: 700px;
    margin: 0 auto;
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #2d3748;
}

.form-group .required {
    color: #e53e3e;
    margin-left: 4px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2b6cb0;
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.1);
}

.form-group input:invalid {
    border-color: #fc8181;
}

/* Buttons in form */
form .btn {
    margin-right: 10px;
    padding: 12px 28px;
    font-size: 1rem;
}

/* Results */
#resultContainer {
    margin-top: 30px;
    padding: 24px;
    background: #f7fafc;
    border-radius: 12px;
    border-left: 6px solid #2b6cb0;
    animation: slideDown 0.3s ease-out;
}

#resultContainer h3 {
    color: #2b6cb0;
    margin-bottom: 16px;
}

.result-grid {
    display: grid;
    gap: 10px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 14px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.result-label {
    font-weight: 500;
    color: #4a5568;
}

.result-value {
    font-weight: 600;
    color: #2d3748;
}

.error {
    color: #e53e3e;
    font-weight: 600;
    padding: 12px;
    background: #fff5f5;
    border-radius: 8px;
    border-left: 4px solid #e53e3e;
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer */
footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: #718096;
    font-size: 0.9rem;
    border-top: 1px solid #e2e8f0;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Responsive */
@media (max-width: 600px) {
    .calculator-grid {
        grid-template-columns: 1fr;
    }
    
    .calculator-container {
        padding: 20px;
    }
    
    header {
        padding: 20px;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .result-item {
        flex-direction: column;
        gap: 4px;
    }
}