/* --- Animation & Microinteraction Enhancements --- */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.6s forwards;
}
.slide-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: slideInUp 0.6s forwards;
}
@keyframes fadeIn {
    to { opacity: 1; }
}
@keyframes slideInUp {
    to { opacity: 1; transform: translateY(0); }
}
.pulse {
    animation: pulseGlow 1s;
}
@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 0 #007bff44; }
    70% { box-shadow: 0 0 12px 8px #007bff33; }
    100% { box-shadow: 0 0 0 0 #007bff00; }
}
.ripple-btn {
    position: relative;
    overflow: hidden;
    z-index: 1;
    transition: background 0.18s, transform 0.15s;
}
.ripple-btn:active {
    transform: scale(0.98);
}
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(0,123,255,0.25);
    transform: scale(0);
    animation: rippleEffect 0.6s linear;
    pointer-events: none;
    width: 120px;
    height: 120px;
    left: 50%;
    top: 50%;
    margin-left: -60px;
    margin-top: -60px;
    z-index: 2;
}
@keyframes rippleEffect {
    to { transform: scale(2.5); opacity: 0; }
}
.loader-text {
    display: inline-block;
    font-size: 1.1em;
    color: #007bff;
    letter-spacing: 0.04em;
    font-weight: 600;
    animation: fadeIn 0.6s;
}
.loader-text .dot {
    animation: blink 1.2s infinite both;
}
.loader-text .dot:nth-child(2) { animation-delay: 0.2s; }
.loader-text .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink {
    0%, 80%, 100% { opacity: 0.2; }
    40% { opacity: 1; }
}
.result-animate {
    transition: box-shadow 0.5s, background 0.5s;
}
input:invalid {
    border-color: #ff4d4f;
    animation: shake 0.4s;
}
@keyframes shake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(4px); }
    30%, 50%, 70% { transform: translateX(-8px); }
    40%, 60% { transform: translateX(8px); }
}
.dropdown, select {
    transition: border 0.3s, box-shadow 0.3s;
}
.dropdown:focus, select:focus {
    box-shadow: 0 0 0 2px #007bff33;
}
body.dark-mode, html.dark-mode {
    background: linear-gradient(135deg, #23272f 0%, #1a1d23 100%) !important;
    color: #e0e7ff !important;
    transition: background 0.5s, color 0.5s;
}
body.dark-mode .container, body.dark-mode .calc-form {
    background: rgba(30,34,40,0.98) !important;
    color: #e0e7ff !important;
    box-shadow: 0 2px 16px rgba(0,0,0,0.18);
    transition: background 0.5s, color 0.5s;
}
body.dark-mode .card {
    background: #23272f !important;
    color: #e0e7ff !important;
    box-shadow: 0 2px 16px rgba(0,0,0,0.18);
    transition: background 0.5s, color 0.5s;
}
body.dark-mode .calc-result, body.dark-mode #result {
    color: #7ecfff !important;
}
body.dark-mode button, body.dark-mode .back-link {
    background: #005fa3 !important;
    color: #fff !important;
    transition: background 0.5s, color 0.5s;
}
body.dark-mode input, body.dark-mode select {
    background: #23272f !important;
    color: #e0e7ff !important;
    border-color: #3a3f4b !important;
    transition: background 0.5s, color 0.5s, border 0.5s;
}
body.dark-mode header {
    background: linear-gradient(90deg, #23272f 60%, #1a1d23 100%) !important;
    color: #e0e7ff !important;
    transition: background 0.5s, color 0.5s;
}
body.dark-mode .loader-text { color: #7ecfff; }
/* --- End Animation & Microinteraction Enhancements --- */
/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Poppins:wght@500;700&display=swap');

body {
    font-family: 'Inter', 'Poppins', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #e0e7ff 0%, #f7f7f7 100%);
    color: #222;
    min-height: 100vh;
}

.container, .calc-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 2rem 1.5rem;
    background: rgba(255,255,255,0.95);
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(0,95,163,0.07);
    max-width: 400px;
    margin-top: 2.5rem;
}

.calc-form label {
    font-size: 1.08rem;
    margin-bottom: 0.3rem;
    font-weight: 500;
    color: #005fa3;
    align-self: flex-start;
}

.form-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    margin-bottom: 1.1rem;
}

input[type="number"], input[type="text"] {
    margin-bottom: 0.2rem;
    padding: 10px 12px;
    border-radius: 5px;
    border: 1px solid #bcd0e0;
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
    transition: border 0.2s;
}
input[type="number"]:focus, input[type="text"]:focus {
    border: 1.5px solid #007bff;
    outline: none;
}

button {
    padding: 10px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.08rem;
    font-weight: 600;
    margin-top: 0.5rem;
    transition: background 0.18s, transform 0.15s;
    box-shadow: 0 2px 8px rgba(0,123,255,0.07);
}
button:hover {
    background-color: #0056b3;
    transform: translateY(-2px) scale(1.03);
}

.calc-result, #result {
    margin-top: 1.2rem;
    font-size: 1.15rem;
    color: #005fa3;
    font-weight: 600;
    min-height: 1.5em;
    text-align: center;
    word-break: break-word;
}

a[href*="index.html"], .back-link {
    color: #fff !important;
    background: #007bff;
    padding: 7px 18px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    margin-top: 1.2rem;
    display: inline-block;
    transition: background 0.18s;
}
a[href*="index.html"]:hover, .back-link:hover {
    background: #0056b3;
}

header h1 {
    font-family: 'Poppins', 'Inter', Arial, sans-serif;
    font-size: 2.1rem;
    margin-bottom: 0.5rem;
    margin-top: 0.5rem;
    font-weight: 700;
}

@media screen and (max-width: 600px) {
    .container, .calc-form {
        padding: 1.2rem 0.5rem 1.2rem 0.5rem;
        max-width: 98vw;
    }
    input, button {
        width: 100%;
        font-size: 1rem;
    }
    header h1 {
        font-size: 1.3rem;
    }
}

header {
    text-align: center;
    padding: 2.5rem 1rem 1.5rem 1rem;
    background: linear-gradient(90deg, #005fa3 60%, #0077c2 100%);
    color: #fff;
    box-shadow: 0 2px 12px rgba(0,95,163,0.08);
    position: relative;
}

.logo {
    width: 90px;
    margin-bottom: 1rem;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.10));
}

.calculator-section {
    margin: 2.5rem auto 0 auto;
    max-width: 1100px;
    padding: 0 1rem;
}
.calculator-section h2 {
    color: #005fa3;
    margin-bottom: 1rem;
    font-size: 1.35rem;
    letter-spacing: 0.5px;
    font-weight: 600;
    text-shadow: 0 1px 0 #fff, 0 2px 8px #e0e7ff;
}

.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(0,95,163,0.07);
    padding: 2.2rem 1.2rem 1.5rem 1.2rem;
    text-align: center;
    text-decoration: none;
    color: #005fa3;
    font-weight: 600;
    font-size: 1.08rem;
    letter-spacing: 0.1px;
    position: relative;
    overflow: hidden;
    transition: transform 0.18s cubic-bezier(.4,2,.6,1), box-shadow 0.18s cubic-bezier(.4,2,.6,1), background 0.18s;
    cursor: pointer;
    z-index: 1;
    animation: fadeInUp 0.7s cubic-bezier(.4,2,.6,1);
}
.card .icon {
    display: block;
    font-size: 2.1rem;
    margin-bottom: 0.7rem;
    transition: transform 0.25s cubic-bezier(.4,2,.6,1);
}
.card:hover {
    background: linear-gradient(120deg, #e0f2fe 0%, #f1f5f9 100%);
    box-shadow: 0 8px 32px rgba(0,95,163,0.18);
    transform: translateY(-7px) scale(1.035);
    z-index: 2;
}
.card:hover .icon {
    transform: scale(1.18) rotate(-8deg);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

footer {
    text-align: center;
    padding: 1.2rem 1rem 1.5rem 1rem;
    background: #f1f5f9;
    color: #555;
    font-size: 0.98rem;
    margin-top: 2.5rem;
    border-top: 1px solid #e0e7ef;
    box-shadow: 0 -2px 8px rgba(0,95,163,0.04);
}

@media (max-width: 900px) {
    .calculator-section {
        max-width: 98vw;
    }
    .calculator-grid {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 600px) {
    .calculator-section {
        padding: 0 0.2rem;
    }
    .calculator-grid {
        padding: 0;
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .card {
        padding: 1.5rem 0.5rem 1.1rem 0.5rem;
        font-size: 1rem;
    }
    header {
        padding: 1.5rem 0.5rem 1rem 0.5rem;
    }
    .logo {
        width: 65px;
    }
}
