:root {
    --primary: #4361ee;
    --secondary: #3f37c9;
    --accent: #4895ef;
    --dark: #1b263b;
    --light: #f8f9fa;
    --success: #4cc9f0;
    --danger: #f72585;
    --warning: #f8961e;
    --info: #560bad;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Poppins', system-ui, -apple-system, sans-serif;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(67, 97, 238, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(67, 97, 238, 0); }
    100% { box-shadow: 0 0 0 0 rgba(67, 97, 238, 0); }
}

@keyframes buttonClick {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0px); }
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    min-height: 100vh;
    padding: 0px 5px;
    color: var(--dark);
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    animation: fadeIn 0.6s ease-out;
    position: relative;
    overflow: hidden;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

h1 {
    text-align: center;
    color: var(--dark);
    margin-bottom: 20px;
    font-size: 26px;
    font-weight: 700;
    position: relative;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

.subtitle {
    text-align: center;
    color: #6c757d;
    margin-bottom: 25px;
    font-size: 14px;
    line-height: 1.4;
}

.calculator-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.input-group {
    position: relative;
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
    font-size: 14px;
}

.input-group input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
    background-color: #f8f9fa;
}

.input-group input:focus {
    border-color: var(--accent);
    outline: none;
    background-color: white;
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.1);
}

.input-group input:hover {
    border-color: #ced4da;
}

.input-icon {
    position: absolute;
    right: 15px;
    top: 38px;
    color: #adb5bd;
    font-size: 14px;
}

.btn-calculate {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: float 3s ease-in-out infinite;
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(67, 97, 238, 0.4);
    animation: pulse 1.5s infinite, float 3s ease-in-out infinite;
}

.btn-calculate:active {
    animation: buttonClick 0.3s ease;
}

.btn-calculate i {
    margin-left: 6px;
    transition: transform 0.3s;
}

.btn-calculate:hover i {
    transform: rotate(-5deg);
}

.results {
    margin-top: 30px;
    display: none;
    animation: fadeIn 0.6s ease-out;
}

.results-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.results h2 {
    color: var(--dark);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 5px;
}

.result-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
    border-left: 4px solid var(--primary);
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px dashed #e9ecef;
    align-items: center;
}

.result-row:last-child {
    border-bottom: none;
}

.result-label {
    font-weight: 500;
    color: #495057;
    display: flex;
    align-items: center;
    font-size: 14px;
}

.result-label i {
    margin-right: 8px;
    color: var(--accent);
    font-size: 16px;
}

.result-value {
    font-weight: 600;
    color: var(--dark);
    font-size: 15px;
}

.total-row {
    background-color: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    margin-top: 15px;
    border-left: 4px solid var(--success);
}

.total-row .result-label {
    font-weight: 700;
    color: var(--dark);
    font-size: 16px;
}

.total-row .result-value {
    font-weight: 700;
    color: var(--success);
    font-size: 18px;
}

.tooltip {
    position: relative;
    display: inline-block;
    margin-left: 5px;
    color: var(--accent);
    cursor: pointer;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 180px;
    background-color: var(--dark);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
    font-weight: normal;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

@media (min-width: 768px) {
    .container {
        padding: 35px;
    }
    
    h1 {
        font-size: 32px;
        margin-bottom: 25px;
    }
    
    h1::after {
        height: 4px;
        width: 80px;
        bottom: -10px;
    }
    
    .subtitle {
        font-size: 16px;
        margin-bottom: 35px;
    }
    
    .calculator-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .results-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .result-label, .result-value {
        font-size: 15px;
    }
    
    .total-row .result-label, 
    .total-row .result-value {
        font-size: 18px;
    }
}

/* Animation classes */
.animate-pop {
    animation: pop 0.4s ease-out;
}

@keyframes pop {
    0% { transform: scale(0.95); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

/* Header Styles */
.main-header {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 10px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
}

.logo i {
    font-size: 28px;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
}

.main-nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.main-nav a:hover {
    color: var(--accent);
}

/* Main Content Styles */
.main-content {
    padding: 30px 0;
    min-height: calc(100vh - 160px);
}

/* Footer Styles */
.main-footer {
    background-color: var(--dark);
    color: white;
    padding: 40px 0 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.footer-section {
    margin-bottom: 30px;
}

.footer-section h3 {
    color: var(--accent);
    margin-bottom: 20px;
    font-size: 18px;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 50px;
    height: 2px;
    background: var(--accent);
}

.footer-section p {
    line-height: 1.6;
    color: #adb5bd;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 10px;
}

.footer-section a {
    color: #adb5bd;
    text-decoration: none;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.footer-section a:hover {
    color: var(--accent);
    padding-left: 5px;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    transition: all 0.3s;
}

.social-links a:hover {
    background: var(--accent);
    transform: translateY(-3px);
}

.footer-bottom {
    background: rgba(0, 0, 0, 0.2);
    text-align: center;
    padding: 15px 0;
    font-size: 14px;
    color: #adb5bd;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .main-nav ul {
        gap: 15px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}