/* Otto Budget Widget - Clean Amber Styling */
/* Extracted from clean widget HTML and adapted for modular CSS architecture */

/* ===== BUDGET WIDGET CONTAINER ===== */
.budget-widget {
    background: var(--otto-primary-light);
    border: 2px solid var(--otto-primary);
    border-radius: 8px;
    padding: 16px;
    margin: 16px 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ===== WIDGET HEADER ===== */
.widget-header h4 {
    margin: 0 0 12px 0;
    color: var(--otto-primary-text);
    font-size: 1.1rem;
    font-weight: 600;
}

/* ===== PAYMENT MODE BUTTONS ===== */
.payment-modes {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.mode-btn {
    padding: 8px 16px;
    border: 2px solid var(--otto-primary);
    background: white;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--otto-primary-text);
    transition: all 0.2s ease;
}

.mode-btn:hover {
    background: var(--otto-primary);
    color: var(--otto-primary-light);
}

.mode-btn.active {
    background: var(--otto-primary);
    color: var(--otto-primary-light);
}

/* ===== SUMMARY LINE ===== */
.summary-line {
    font-size: 0.8rem;
    color: var(--otto-primary-text);
    margin-top: 8px;
    padding: 8px 12px;
    background: white;
    border-radius: 4px;
    border: 1px solid var(--otto-primary);
    font-weight: 500;
}

/* ===== CONTROLS SECTION ===== */
.controls-section {
    background: white;
    border: 1px solid var(--otto-primary);
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
}

/* ===== PRIMARY CONTROL (SLIDER AREA) ===== */
.primary-control {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.control-label {
    font-weight: 600;
    color: var(--otto-primary-text);
    font-size: 0.9rem;
    min-width: 80px;
}

.current-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--otto-primary-text);
    margin-top: 4px;
}

.slider-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ===== SLIDER STYLING ===== */
.slider {
    width: 100%;
    height: 8px;
    background: var(--otto-primary);
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
    position: relative;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--otto-primary-light);
    border: 2px solid var(--otto-primary-text);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    background: white;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--otto-primary-light);
    border: 2px solid var(--otto-primary-text);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.slider::-moz-range-track {
    height: 8px;
    background: var(--otto-primary);
    border-radius: 4px;
}

/* ===== RANGE LABELS ===== */
.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--otto-text-light);
    margin-top: 4px;
}

/* ===== SECONDARY CONTROLS ===== */
.secondary-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.control-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--otto-primary-text);
}

/* ===== INPUT FIELDS ===== */
.input-field {
    padding: 8px 12px;
    border: 1px solid var(--otto-primary);
    border-radius: 4px;
    background: white;
    font-size: 0.85rem;
    color: var(--otto-text);
    transition: border-color 0.2s ease;
}

.input-field:focus {
    outline: none;
    border-color: var(--otto-primary-text);
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.1);
}

.input-field.medium {
    width: 68%;
}

.input-field.large {
    width: 85%;
}

/* ===== TOGGLE BUTTONS ===== */
.button-toggle {
    display: flex;
}

.toggle-btn {
    padding: 6px 12px;
    border: 1px solid var(--otto-primary);
    background: white;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--otto-primary-text);
    transition: all 0.2s ease;
}

.toggle-btn:first-child {
    border-radius: 4px 0 0 4px;
}

.toggle-btn:last-child {
    border-radius: 0 4px 4px 0;
    border-left: none;
}

.toggle-btn:hover {
    background: var(--otto-primary);
    color: var(--otto-primary-light);
}

.toggle-btn.active {
    background: var(--otto-primary);
    color: var(--otto-primary-light);
}

/* ===== ACTION AREA ===== */
.action-area {
    text-align: center;
    margin-top: 16px;
}

.confirm-btn {
    background: var(--otto-primary-text);
    color: var(--otto-primary-light);
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
}

.confirm-btn:hover:not(:disabled) {
    background: #7c2d12;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.confirm-btn:disabled {
    background: var(--otto-text-light);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.confirm-btn.disabled {
    background: var(--otto-text-light);
    cursor: not-allowed;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .budget-widget {
        padding: 12px;
        margin: 12px 0;
    }
    
    .primary-control {
        grid-template-columns: 1fr;
        gap: 8px;
        text-align: center;
    }
    
    .payment-modes {
        justify-content: center;
    }
    
    .mode-btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    
    .secondary-controls {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .input-field.medium,
    .input-field.large {
        width: 100%;
    }
    
    .control-group > div {
        align-items: stretch;
    }
    
    .button-toggle {
        justify-content: center;
        margin-bottom: 8px;
    }
    
    .confirm-btn {
        font-size: 0.9rem;
        padding: 10px 20px;
    }
}

@media (max-width: 480px) {
    .budget-widget {
        padding: 8px;
        margin: 8px 0;
    }
    
    .widget-header h4 {
        font-size: 1rem;
        text-align: center;
    }
    
    .payment-modes {
        flex-direction: column;
        gap: 4px;
    }
    
    .mode-btn {
        width: 100%;
        text-align: center;
    }
    
    .slider {
        height: 10px;
    }
    
    .slider::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }
    
    .current-value {
        font-size: 1.2rem;
        text-align: center;
    }
    
    .summary-line {
        font-size: 0.75rem;
        text-align: center;
    }
}

/* ===== INTEGRATION WITH EXISTING OTTO STYLES ===== */
/* Ensure budget widget inherits Otto's amber theme variables */
.enhanced-budget-calculator.budget-widget {
    /* Use existing enhanced-budget-calculator class for compatibility */
    /* All styles above apply automatically */
}

/* ===== ACCESSIBILITY ENHANCEMENTS ===== */
.slider:focus {
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.3);
}

.mode-btn:focus,
.toggle-btn:focus,
.confirm-btn:focus {
    outline: 2px solid var(--otto-primary-text);
    outline-offset: 2px;
}

.input-field:focus {
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.3);
}

/* ===== SMOOTH ANIMATIONS ===== */
@keyframes budgetWidgetAppear {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.budget-widget {
    animation: budgetWidgetAppear 0.3s ease-out;
}

/* ===== LOADING STATE ===== */
.budget-widget.loading {
    pointer-events: none;
    opacity: 0.7;
}

.budget-widget.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
}