/* ===================================
   CALCULATOR SECTION STYLES
   =================================== */

.calculator-section {
    background: linear-gradient(135deg, #F8FAFB 0%, #E8F4F8 100%);
}

.calculator-wrapper {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: 50%;
    max-width: 600px;
    margin: 2rem auto;
}

/* ===================================
   CALCULATOR TABS
   =================================== */

.calculator-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border-bottom: 2px solid var(--border-color);
}

.tab-button {
    background-color: #FAFBFC;
    border: none;
    padding: 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.3s ease;
    position: relative;
}

.tab-button:hover {
    background-color: #F0F5FF;
    color: var(--primary-color);
}

.tab-button.active {
    background-color: white;
    color: var(--primary-color);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--primary-color);
}

/* ===================================
   CALCULATOR INPUTS
   =================================== */

.calculator {
    display: none;
    padding: 2rem;
    animation: fadeIn 0.3s ease;
}

.calculator.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.calc-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.input-with-unit {
    display: flex;
    gap: 0.5rem;
}

.input-with-unit input,
.input-with-unit select {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    font-family: var(--font-family);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.input-with-unit input {
    flex: 2;
}

.input-with-unit input:focus,
.input-with-unit select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.input-group select {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    font-family: var(--font-family);
    background-color: white;
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
}

/* ===================================
   CALCULATOR BUTTON
   =================================== */

.calc-button {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.calc-button:hover {
    background-color: #357ABD;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

.calc-button:active {
    transform: translateY(0);
}

/* ===================================
   RESULT BOX
   =================================== */

.result-box {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: var(--light-bg);
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-box h3 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.result-display {
    background-color: white;
    padding: 1.5rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    text-align: center;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.result-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    word-break: break-all;
}

.result-unit {
    display: block;
    font-size: 1.1rem;
    color: var(--text-light);
    font-weight: 500;
}

.result-formula {
    background-color: white;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.result-formula p {
    margin: 0.5rem 0;
    color: var(--text-dark);
}

.result-formula p strong {
    color: var(--primary-color);
}

/* ===================================
   SHARE BUTTON
   =================================== */

.share-button {
    background-color: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-button:hover {
    background-color: var(--primary-color);
    color: white;
}

/* ===================================
   UTILITY: HIDDEN
   =================================== */

.hidden {
    display: none !important;
}

/* ===================================
   RESPONSIVE CALCULATOR
   =================================== */

@media (max-width: 768px) {
    .calculator-wrapper {
        width: 75%;
    }

    .calculator-tabs {
        grid-template-columns: repeat(2, 1fr);
    }

    .tab-button {
        padding: 0.75rem;
        font-size: 0.8rem;
    }

    .calculator {
        padding: 1.5rem;
    }

    .calc-inputs {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .result-value {
        font-size: 1.5rem;
    }

    .result-unit {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .calculator-wrapper {
        width: 90%;
        margin: 1rem auto;
    }

    .calculator-tabs {
        grid-template-columns: 1fr;
    }

    .tab-button {
        padding: 0.5rem;
        font-size: 0.75rem;
        text-align: center;
    }

    .calculator {
        padding: 1rem;
    }

    .calc-inputs {
        grid-template-columns: 1fr;
    }

    .input-with-unit {
        flex-direction: column;
    }

    .input-with-unit input,
    .input-with-unit select {
        width: 100%;
    }

    .result-box {
        padding: 1rem;
    }

    .result-display {
        padding: 1rem;
    }

    .result-value {
        font-size: 1.25rem;
    }
}
