/* Base Styles */
.margin-calculator {
    font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    max-width: 600px;
    margin: 0 auto;
    color: #333;
}

.calculator-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8faff 100%);
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.calculator-header {
    background: linear-gradient(135deg, #2a3042 0%, #3a4356 100%);
    color: #fff;
    padding: 20px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.calculator-header h3 {
    margin: 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.calculator-header p {
    margin: 5px 0 0;
    opacity: 0.8;
    font-size: 0.85rem;
}

.calculator-body {
    display: flex;
    flex-wrap: wrap;
}

.input-section {
    flex: 1;
    min-width: 300px;
    padding: 22px 24px;
    border-right: 1px solid #eee;
}

.results-section {
    flex: 1;
    min-width: 250px;
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    margin-bottom: 22px;
    padding: 0 2px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #555;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    margin: 4px 0 6px;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #3a7bd5;
    background: #fff;
}

.calculate-btn {
    width: 100%;
    padding: 14px 16px;
    background: linear-gradient(135deg, #3a7bd5 0%, #2c6bc7 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    transform: translateY(0);
    transition: all 0.2s ease;
}

.calculate-btn.loading {
    color: transparent;
}

.calculate-btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.calculate-btn:hover {
    background: #2c6bc7;
}

.result-box {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease;
}

.result-box:hover {
    transform: translateY(-2px);
}

.result-title {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.result-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2a3042;
    line-height: 1.2;
}

.result-currency {
    font-size: 1rem;
    color: #3a7bd5;
    font-weight: 500;
}

.calculator-footer {
    padding: 12px 20px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    font-size: 0.8rem;
    color: #777;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .calculator-body {
        flex-direction: column;
    }
    
    .input-section {
        border-right: none;
        border-bottom: 1px solid #eee;
    }
}

/* Loading State Styles */
.calculator-container.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.calculator-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3a7bd5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.calculate-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}