@import url('https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}

body {
    font-family: "Poppins", sans-serif;
}

.section {
    padding: 50px 0;
    color: #333;
}

.age-container {
    background-color: white;
    width: 100%;
    max-width: 1200px;
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    margin: 0 auto;
}

.sub-header {
    background: linear-gradient(to right, #2575fc, #6a11cb);
    color: white;
    padding: 30px 40px;
    text-align: center;
}

h1 {
    font-size: 2.8rem;
    margin-bottom: 10px;
}

.description {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto 20px;
    line-height: 1.6;
}

.calculator-container {
    display: flex;
    flex-wrap: wrap;
    padding: 30px;
}

.input-section {
    flex: 1;
    min-width: 300px;
    padding: 20px;
}

.result-section {
    flex: 1;
    min-width: 300px;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 12px;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.05);
}

.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 1.1rem;
    color: #444;
}

.date-input {
    display: flex;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.date-input input {
    flex: 1;
    padding: 15px;
    border: none;
    font-size: 1.1rem;
    outline: none;
}

.date-input button {
    background: #f0f4ff;
    border: none;
    padding: 0 18px;
    cursor: pointer;
    color: #2575fc;
    font-size: 1.2rem;
    transition: background 0.3s;
}

.date-input button:hover {
    background: #e0e8ff;
}

.btn-calculate {
    background: linear-gradient(to right, #2575fc, #6a11cb);
    color: white;
    border: none;
    padding: 16px 30px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 5px 15px rgba(37, 117, 252, 0.4);
}

.btn-calculate:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(37, 117, 252, 0.6);
}

.btn-calculate:active {
    transform: translateY(-1px);
}

.result-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: #2575fc;
    font-weight: 600;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.result-box {
    background: white;
    border-radius: 10px;
    padding: 20px 10px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.result-box:hover {
    transform: translateY(-5px);
}

.result-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #2575fc;
    margin-bottom: 5px;
}

.result-label {
    font-size: 0.95rem;
    color: #666;
    font-weight: 500;
}

.explanation {
    margin-top: 35px;
    padding: 25px;
    background: #f8f9ff;
    border-top: 1px solid #eaefff;
}

.explanation h2 {
    color: #2575fc;
    margin-bottom: 15px;
    text-align: center;
}

.explanation p {
    margin-bottom: 15px;
    line-height: 1.7;
}

.note {
    background: #fffae6;
    border-left: 4px solid #ffcc00;
    padding: 15px;
    margin: 15px 0;
    border-radius: 0 8px 8px 0;
}

.error {
    background: #ffebee;
    color: #e53935;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    display: none;
}

.error.show {
    display: block;
}

/* CSS added for formula */

.calculation-formula-section {
    margin: 60px;
    padding: 30px;
    background-color: #f9f9f9;
    border-radius: 10px;
    border: 1px dashed #e0e0e0;
    text-align: left; /* Override parent center alignment */
}

.calculation-formula-section h2 {
    color: #0056b3;
    font-size: 1.8em;
    margin-bottom: 20px;
    text-align: center;
}

.calculation-formula-section h3 {
    color: #333;
    font-size: 1.4em;
    margin-top: 25px;
    margin-bottom: 15px;
}

.calculation-formula-section h4 {
    color: #007bff;
    font-size: 1.2em;
    margin-top: 20px;
    margin-bottom: 10px;
}

.calculation-formula-section p,
.calculation-formula-section ul,
.calculation-formula-section ol {
    line-height: 1.6;
    margin-bottom: 10px;
    color: #555;
}

.calculation-formula-section pre {
    background-color: #eef;
    border: 1px solid #ddd;
    border-left: 5px solid #007bff;
    padding: 10px 15px;
    margin: 15px 0;
    overflow-x: auto; /* For long code lines */
    border-radius: 5px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95em;
}

.calculation-formula-section code {
    font-family: 'Courier New', Courier, monospace;
    color: #c7254e; /* For inline code snippets */
    background-color: #f9f2f4;
    padding: 2px 4px;
    border-radius: 3px;
}

.calculation-formula-section ul {
    list-style-type: disc;
    margin-left: 25px;
}

.calculation-formula-section ul ul { /* Nested lists */
    list-style-type: circle;
    margin-left: 20px;
}






@media (max-width: 768px) {
    .calculator-container {
        flex-direction: column;
    }
    
    .result-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .result-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    header {
        padding: 0;
    }
}
