/**
 * Frontend Styles for Flexible Cost Calculator
 *
 * @package FlexibleCostCalculator
 */

/* ==========================================================================
   Calculator Container
   ========================================================================== */

.fcc-calculator {
    max-width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.fcc-calculator-title {
    margin: 0 0 30px 0;
    font-size: 28px;
    font-weight: 600;
    color: #161616;
    text-align: center;
}

/* ==========================================================================
   Form Fields
   ========================================================================== */

.fcc-field {
    margin-bottom: 25px;
}

.fcc-field-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #161616;
    font-size: 16px;
}

.fcc-required {
    color: #da1e28;
    margin-left: 4px;
}

.fcc-field-description {
    display: block;
    font-weight: 400;
    color: #6f6f6f;
    font-size: 14px;
    margin-top: 4px;
}

.fcc-input,
.fcc-select,
.fcc-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #8d8d8d;
    border-radius: 4px;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.fcc-input:focus,
.fcc-select:focus,
.fcc-textarea:focus {
    outline: none;
    border-color: #0f62fe;
    box-shadow: 0 0 0 2px rgba(15, 98, 254, 0.2);
}

/* ==========================================================================
   Slider Field
   ========================================================================== */

.fcc-slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.fcc-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
}

.fcc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0f62fe;
    cursor: pointer;
}

.fcc-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0f62fe;
    cursor: pointer;
    border: none;
}

.fcc-slider-value {
    min-width: 60px;
    padding: 8px 12px;
    background: #f4f4f4;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
}

/* ==========================================================================
   Stepper Field
   ========================================================================== */

.fcc-stepper {
    display: flex;
    align-items: center;
    max-width: 200px;
}

.fcc-stepper-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #8d8d8d;
    background: #f4f4f4;
    color: #161616;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.fcc-stepper-btn:hover {
    background: #e0e0e0;
}

.fcc-stepper-minus {
    border-radius: 4px 0 0 4px;
}

.fcc-stepper-plus {
    border-radius: 0 4px 4px 0;
}

.fcc-stepper-input {
    width: 80px;
    text-align: center;
    border-left: none;
    border-right: none;
    border-radius: 0;
}

/* ==========================================================================
   Radio and Checkbox Fields
   ========================================================================== */

.fcc-radio-group,
.fcc-multiselect {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.fcc-radio-label,
.fcc-checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.fcc-radio-label:hover,
.fcc-checkbox-label:hover {
    border-color: #0f62fe;
    background: #f0f7ff;
}

.fcc-radio,
.fcc-checkbox {
    width: 18px;
    height: 18px;
    margin: 0;
}

.fcc-radio-text,
.fcc-checkbox-text {
    flex: 1;
    font-size: 16px;
    color: #161616;
}

/* ==========================================================================
   Toggle Field
   ========================================================================== */

.fcc-toggle {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
}

.fcc-toggle-input {
    display: none;
}

.fcc-toggle-slider {
    position: relative;
    width: 50px;
    height: 24px;
    background: #8d8d8d;
    border-radius: 12px;
    transition: background 0.3s ease;
}

.fcc-toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.fcc-toggle-input:checked + .fcc-toggle-slider {
    background: #0f62fe;
}

.fcc-toggle-input:checked + .fcc-toggle-slider::before {
    transform: translateX(26px);
}

.fcc-toggle-label {
    font-size: 16px;
    color: #161616;
}

/* ==========================================================================
   Results Section
   ========================================================================== */

.fcc-results {
    margin-top: 40px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.fcc-live-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 6px;
    border: 2px solid #0f62fe;
}

.fcc-total-label {
    font-size: 20px;
    font-weight: 600;
    color: #161616;
}

.fcc-total-amount {
    font-size: 28px;
    font-weight: 700;
    color: #0f62fe;
}

.fcc-breakdown {
    background: #fff;
    border-radius: 6px;
    padding: 20px;
    margin-top: 20px;
}

.fcc-breakdown h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #161616;
}

.fcc-breakdown-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fcc-breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.fcc-breakdown-item:last-child {
    border-bottom: none;
    font-weight: 600;
    font-size: 16px;
}

/* ==========================================================================
   Lead Capture & Actions
   ========================================================================== */

.fcc-lead-capture {
    margin-top: 30px;
    padding: 25px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.fcc-lead-capture h4 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #161616;
}

.fcc-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

.fcc-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.fcc-btn-primary {
    background: #0f62fe;
    color: #fff;
}

.fcc-btn-primary:hover {
    background: #0353e9;
}

.fcc-btn-secondary {
    background: #6f6f6f;
    color: #fff;
}

.fcc-btn-secondary:hover {
    background: #525252;
}

/* ==========================================================================
   Loading & Error States
   ========================================================================== */

.fcc-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    font-size: 16px;
    color: #6f6f6f;
}

.fcc-loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    border-top-color: #0f62fe;
    animation: fcc-spin 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes fcc-spin {
    to { 
        transform: rotate(360deg); 
    }
}

.fcc-error {
    background: #fdf2f2;
    color: #da1e28;
    border: 1px solid #ffc9c9;
    border-radius: 4px;
    padding: 15px;
    margin: 15px 0;
    text-align: center;
}

/* ==========================================================================
   Media Queries
   ========================================================================== */

@media (max-width: 768px) {
    .fcc-calculator {
        padding: 20px;
        margin: 10px;
    }
    
    .fcc-live-total {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .fcc-actions {
        flex-direction: column;
    }
    
    .fcc-radio-group,
    .fcc-multiselect {
        gap: 8px;
    }
    
    .fcc-slider-container {
        flex-direction: column;
        gap: 10px;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .fcc-calculator {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .fcc-actions,
    .fcc-loading {
        display: none;
    }
    
    .fcc-results {
        background: #fff;
        border: 1px solid #ddd;
    }
}
