/*
Afa Calculator styling
*/

.afa-calculator-block {
    .afa-widget {
        font-family: Arial, sans-serif;
        max-width: 1000px;
        margin: 2rem auto;
        padding: 1.5rem;
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
    }

    /* Mobile responsiveness */
    @media (max-width: 768px) {
        .afa-widget {
            margin: 1rem;
            padding: 1rem;
            max-width: none;
        }

        .afa-row {
            flex-direction: column;
            gap: 1rem;
        }

        .afa-field {
            width: 100%;
        }

        .afa-input-group {
            flex-wrap: wrap;
            gap: 0.5rem;
        }

        .afa-input-group input[style*="width:60px"] {
            width: 80px !important;
        }

        .chart-container {
            height: 300px;
            padding: 0.5rem;
        }

        .afa-results table {
            font-size: 0.9rem;
        }

        .afa-results th,
        .afa-results td {
            padding: 0.5rem;
        }
    }

    @media (max-width: 480px) {
        .afa-widget {
            margin: 0.5rem;
            padding: 0.75rem;
        }

        .afa-section h2 {
            font-size: 1.1rem;
        }

        .chart-container {
            height: 250px;
        }

        .afa-input-group {
            flex-direction: column;
            align-items: stretch;
        }

        .afa-input-group input,
        .afa-input-group select {
            border-radius: 4px !important;
            margin: 0 !important;
        }

        .afa-unit {
            border-radius: 4px !important;
            margin-top: 0.25rem;
            text-align: center;
        }
    }

    .afa-section {
        margin-bottom: 2rem;
    }

    .afa-section h2 {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }

    .afa-row {
        display: flex;
        gap: 2rem;
        margin-bottom: 1rem;
    }

    .afa-field {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 0.3rem;
    }

    .afa-field label {
        font-weight: bold;
        font-size: 0.9rem;
        color: #333;
    }

    .afa-input-group {
        display: flex;
        align-items: center;
    }

    .afa-field input,
    .afa-field select {
        padding: 0.5rem;
        border: 1px solid #ccc;
        border-radius: 4px 0 0 4px;
        flex: 1;
        box-sizing: border-box;
        height: 40px;
    }

    .afa-field select {
        border-radius: 4px;
    }

    .afa-unit {
        background: #3d4952;
        color: white;
        padding: 0.5rem 0.8rem;
        border-radius: 0 4px 4px 0;
        font-weight: bold;
        font-size: 0.9rem;
        line-height: 1;
        height: 100%;
        display: flex;
        align-items: center;
        box-sizing: border-box;
    }

    .afa-field.full-width {
        flex: 2;
    }

    .afa-field input[readonly] {
        background: #f5f5f5;
    }

    .afa-field input.manual {
        border-color: #3c763d;
        background: #dff0d8;
    }

    .afa-results table {
        width: 100%;
        border-collapse: collapse;
        font-size: 1rem;
    }

    .afa-results th,
    .afa-results td {
        border-bottom: 1px solid #ddd;
        padding: 0.75rem;
        text-align: left;
    }

    .afa-results th {
        font-weight: bold;
    }

    .calc-text {
        font-size: 0.95rem;
        margin-top: 1rem;
    }

    .highlight-number {
        color: #3d4952;
        font-weight: bold;
    }

    .chart-container {
        position: relative;
        height: 400px;
        margin: 2rem 0;
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 1rem;
    }

    /* Checkbox styling */
    .checkbox-container {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        position: relative;
    }

    .checkbox-container input[type="checkbox"] {
        margin: 0;
        width: 16px;
        height: 16px;
    }

    .checkbox-container .tooltip {
        margin-left: 0.5rem;
        cursor: help;
        color: #666;
        font-weight: normal;
        position: relative;
        font-size: 14px;
        width: 16px;
        height: 16px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: #f0f0f0;
    }

    .tooltip:hover::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: 125%;
        left: 50%;
        transform: translateX(-50%);
        background: #333;
        color: white;
        padding: 0.5rem;
        border-radius: 4px;
        font-size: 0.8rem;
        z-index: 1000;
        max-width: 250px;
        white-space: normal;
        width: max-content;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

    .tooltip:hover::before {
        content: '';
        position: absolute;
        bottom: 120%;
        left: 50%;
        transform: translateX(-50%);
        border: 5px solid transparent;
        border-top-color: #333;
        z-index: 1000;
    }
}