/* Modal Styles */
.hfa-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hfa-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.hfa-modal-content {
    position: relative;
    background: #fff;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 110vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.hfa-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    z-index: 10;
}

.hfa-modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

/* Button Styles */
.hfa-open-button {
    display: block;
    background: #fff;
    color: #1d1d1f;
    border: 1px solid #e5e5e5;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 3px;
    cursor: pointer;
    margin-bottom: 20px;
    width: 50%;
    margin: 0 auto 20px auto; /* centers the button */
    transition: all 0.3s;
}

.hfa-open-button:hover {
    background: #6e6e73;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
    color: #fff;
}

/* Wizard Styles */
.hfa-wizard {
    padding: 40px 30px 30px;
}

.hfa-wizard-header {
    margin-bottom: 30px;
}

.hfa-wizard-header h2 {
    margin: 0 0 15px;
    font-size: 21px;
    color: #333;
}

.hfa-progress {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.hfa-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #000, #c5c5c5);
    transition: width 0.3s ease;
}

.hfa-wizard-body {
    min-height: 250px;
    margin-bottom: 30px;
}

.hfa-step {
    display: none;
    animation: fadeIn 0.3s;
}

.hfa-step-active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hfa-step h3 {
    margin: 0 0 20px;
    font-size: 20px;
    color: #333;
}

.hfa-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

/* Input Styles */
.hfa-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.hfa-input {
    flex: 1;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    transition: border-color 0.2s;
}

.hfa-input:focus {
    outline: none;
    border-color: #0073aa;
}

.hfa-unit {
    font-size: 15px;
    color: #666;
    font-weight: 500;
}

.hfa-error {
    color: #d63638;
    font-size: 14px;
    margin-top: 5px;
}

/* Options Styles */
.hfa-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hfa-option {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.hfa-option:hover {
    border-color: #0073aa;
    background: #f8f9fa;
}

.hfa-option input[type="radio"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.hfa-option input[type="radio"]:checked + .hfa-option-label {
    color: #0073aa;
}

.hfa-option-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hfa-option-label strong {
    font-size: 15px;
}

.hfa-option-label small {
    font-size: 13px;
    color: #666;
}

/* Result Styles */
.hfa-result {
    text-align: center;
}

.hfa-loading {
    padding: 40px 20px;
}

.hfa-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hfa-result-content,
.hfa-result-error {
    padding: 20px;
}

.hfa-result-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.hfa-result-size {
    font-size: 48px;
    font-weight: bold;
    color: #0073aa;
    margin: 20px 0;
}

.hfa-result-confidence {
    font-size: 16px;
    color: #666;
    margin-bottom: 10px;
}

.hfa-result-reason {
    font-size: 14px;
    color: #999;
}

.hfa-error-message {
    color: #666;
    font-size: 16px;
}

/* Footer Styles */
.hfa-wizard-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.hfa-btn {
    padding: 12px 24px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.hfa-btn-primary {
    background: #000;
    color: #fff;
}

.hfa-btn-primary:hover {
    background: #6e6e73;
    color: #fff;
}

.hfa-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.hfa-btn-secondary:hover {
    background: #e0e0e0;
}

.hfa-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .hfa-modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .hfa-wizard {
        padding: 30px 20px 20px;
    }
    
    .hfa-wizard-header h2 {
        font-size: 20px;
    }
    
    .hfa-step h3 {
        font-size: 17px;
    }
    
    .hfa-result-size {
        font-size: 36px;
    }
    
    .hfa-wizard-footer {
        flex-direction: column-reverse;
    }
    
    .hfa-btn {
        width: 100%;
    }
}
