:root {
    --primary-color: #2c3e50;
    --accent-color: #3498db;
    --success-color: #2ecc71;
    --text-color: #2c3e50;
    --border-radius: 10px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    margin: 0;
    padding: 40px 20px;
    min-height: 100vh;
}

.calculator-container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

h1 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 2.5rem;
    font-size: 2.5rem;
    font-weight: 600;
    position: relative;
    padding-bottom: 15px;
}

h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 2px;
}

.input-group {
    margin-bottom: 2rem;
    position: relative;
}

label {
    display: block;
    margin-bottom: 0.8rem;
    color: var(--text-color);
    font-weight: 500;
    font-size: 1.1rem;
}

select, input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    background: #f8fafc;
}

select:focus, input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.1);
}

button {
    background: var(--accent-color);
    color: white;
    padding: 1.2rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    width: 100%;
    font-size: 1.1rem;
    font-weight: 600;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
}

button:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(52, 152, 219, 0.2);
}

.result-container {
    margin-top: 3rem;
    padding: 2rem;
    background: #f8fafc;
    border-radius: var(--border-radius);
    border: 2px solid #e0e0e0;
}

.result-container h2 {
    color: var(--primary-color);
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1.8rem;
}

.result-grid {
    display: grid;
    gap: 1.5rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.result-item:hover {
    transform: translateX(5px);
}

.result-item.total {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    font-size: 1.2rem;
    margin-top: 1rem;
}

#downloadPDF, #shareWhatsApp {
    margin-top: 1rem;
}

#shareWhatsApp {
    background: #25D366;
}

#shareWhatsApp:hover {
    background: #128C7E;
}

@media screen and (max-width: 768px) {
    .calculator-container {
        padding: 1.5rem;
    }

    h1 {
        font-size: 2rem;
    }

    button {
        padding: 1rem 1.5rem;
    }
}

/* Added animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-container.show {
    animation: slideIn 0.5s ease forwards;
}

.hidden {
    display: none;
}

.modern-back-button {
    position: fixed;
    top: 30px;
    left: 30px;
    display: flex;
    align-items: center;
    text-decoration: none;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px;
    border-radius: 15px;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.05),
        0 8px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.back-icon-wrapper {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-color), #2ecc71);
    border-radius: 12px;
    margin-right: 12px;
}

.back-arrow {
    position: relative;
    width: 20px;
    height: 20px;
}

.back-arrow span {
    position: absolute;
    width: 12px;
    height: 2px;
    background: white;
    border-radius: 1px;
    transition: transform 0.3s ease;
}

.back-arrow span:first-child {
    transform: rotate(-45deg);
    top: 12px;
    left: 2px;
}

.back-arrow span:last-child {
    transform: rotate(45deg);
    top: 6px;
    left: 2px;
}

.back-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.text-top {
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.text-bottom {
    font-size: 1rem;
    color: var(--primary-color);
    font-weight: 600;
}

.modern-back-button:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.1),
        0 10px 40px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.95);
}

.modern-back-button:hover .back-arrow span:first-child {
    transform: rotate(-45deg) scaleX(1.2);
}

.modern-back-button:hover .back-arrow span:last-child {
    transform: rotate(45deg) scaleX(1.2);
}

.modern-back-button:active {
    transform: translateY(0) scale(0.98);
}

@media screen and (max-width: 768px) {
    .modern-back-button {
        top: 20px;
        left: 20px;
        padding: 8px;
    }

    .back-icon-wrapper {
        width: 32px;
        height: 32px;
    }

    .text-top {
        font-size: 0.65rem;
    }

    .text-bottom {
        font-size: 0.9rem;
    }
}

/* Mobile Responsive Styles for back button */
@media screen and (max-width: 768px) {
    .fancy-back-btn {
        top: 15px;
        left: 15px;
        padding: 8px 16px;
    }

    .back-btn-inner i {
        font-size: 1rem;
    }

    .back-btn-inner span {
        font-size: 0.9rem;
    }
}

/* Mobile Responsive Styles */
@media screen and (max-width: 768px) {
    .animated-back-btn {
        top: 10px;
        left: 10px;
    }
    
    .animated-back-btn .circle {
        width: 35px;
        height: 35px;
    }
    
    .animated-back-btn .circle i {
        font-size: 1rem;
    }
}
