/* Enhanced UX Styles for Neighborhood Analyst */

/* Progress Steps and Indicators */
.progress-steps {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
    position: relative;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.progress-step::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #e9ecef;
    z-index: 1;
}

.progress-step:last-child::before {
    display: none;
}

.progress-step.active::before {
    background: var(--accent-color);
}

.progress-step.completed::before {
    background: var(--accent-color);
}

.step-indicator {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #6c757d;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.step-indicator.active {
    background: var(--accent-color);
    color: white;
}

.step-indicator.completed {
    background: #28a745;
    color: white;
}

.step-label {
    font-size: 0.8em;
    margin-top: 8px;
    text-align: center;
    color: #6c757d;
}

.step-label.active {
    color: var(--accent-color);
    font-weight: 600;
}

.step-label.completed {
    color: #28a745;
    font-weight: 600;
}

/* Enhanced Loading States */
.loading-enhanced {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
    text-align: center;
}

.loading-steps {
    margin: 20px 0;
    max-width: 400px;
}

.loading-step {
    display: flex;
    align-items: center;
    margin: 10px 0;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.loading-step.active {
    opacity: 1;
}

.loading-step.completed {
    opacity: 1;
}

.loading-step-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.loading-step-icon.pending {
    background: #e9ecef;
    color: #6c757d;
}

.loading-step-icon.active {
    background: var(--accent-color);
    color: white;
    animation: pulse 1.5s infinite;
}

.loading-step-icon.completed {
    background: #28a745;
    color: white;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Smart Progress Bar */
.smart-progress {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    color: white;
    font-size: 0.9em;
}

.progress-bar-container {
    width: 100%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), var(--primary-color));
    border-radius: 10px;
    transition: width 0.4s ease-in-out;
}

/* Enhanced Form Validation */
.required-indicator {
    color: #dc3545;
    margin-left: 2px;
}

.field-suggestion {
    background: #e8f4f8;
    border: 1px solid #b3d9ff;
    border-radius: 6px;
    padding: 12px;
    margin-top: 8px;
    font-size: 0.9em;
    color: #005a9e;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Auto-save Indicator */
.auto-save-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 0.9em;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Recovery Message */
.recovery-message {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
    position: relative;
}

.recovery-message button {
    float: right;
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    color: #856404;
}

/* Help System */
.help-button {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 25px;
    font-size: 0.9em;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.help-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.help-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.help-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.help-sections {
    margin: 20px 0;
}

.help-section {
    margin-bottom: 20px;
}

.help-section h4 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.help-section ul {
    margin: 10px 0;
    padding-left: 20px;
}

.help-section li {
    margin-bottom: 5px;
}

.close-help {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 20px;
}

/* System Messages */
.system-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 20px;
    border-radius: 5px;
    color: white;
    font-weight: 600;
    z-index: 1001;
    animation: slideDown 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Mobile Navigation Dots */
.mobile-nav-dots {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    gap: 8px;
}

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e9ecef;
    transition: all 0.3s ease;
}

.nav-dot.active {
    background: var(--accent-color);
    transform: scale(1.2);
}

.nav-dot.completed {
    background: #28a745;
}

/* Mobile Floating Action Button */
.mobile-fab {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent-color);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    transition: all 0.3s ease;
}

.mobile-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* Enhanced Mobile Experience */
@media (max-width: 768px) {
    /* Improved touch targets */
    .btn, input, textarea, select {
        min-height: 44px; /* iOS recommended touch target size */
    }
    
    /* Better spacing for mobile */
    .question {
        margin-bottom: 30px;
    }
    
    .radio-option {
        padding: 20px;
        margin-bottom: 10px;
    }
    
    /* Swipe navigation for mobile */
    .form-step {
        touch-action: pan-y;
    }
    
    /* Show mobile FAB */
    .mobile-fab {
        display: flex;
    }
    
    /* Improved mobile navigation */
    .mobile-nav-dots {
        display: flex;
    }
    
    /* Enhanced mobile progress */
    .progress-steps {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .step-label {
        font-size: 0.7em;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000080;
        --accent-color: #0000ff;
        --text-color: #000000;
    }
    
    .btn, input, textarea, select {
        border-width: 2px;
    }
}

/* Focus indicators for accessibility */
.btn:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Skip to content link for screen readers */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1002;
}

.skip-link:focus {
    top: 6px;
}

/* Enhanced form field states */
.form-field-enhanced {
    position: relative;
}

.form-field-enhanced input:focus + .field-highlight,
.form-field-enhanced textarea:focus + .field-highlight {
    background: rgba(0, 123, 255, 0.1);
    border-color: var(--accent-color);
}

.field-highlight {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    pointer-events: none;
    transition: all 0.3s ease;
}

/* Smart completion indicator */
.completion-indicator {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(40, 167, 69, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.completion-indicator.show {
    opacity: 1;
}

/* Enhanced error states */
.error-enhanced {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1) !important;
}

.error-enhanced:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2) !important;
}

/* Success states */
.success-enhanced {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1) !important;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-overlay.hidden {
    display: none;
}

/* Enhanced spinner */
.spinner-enhanced {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Progress steps for mobile */
@media (max-width: 480px) {
    .progress-steps {
        flex-direction: column;
        gap: 15px;
    }
    
    .progress-step::before {
        display: none;
    }
    
    .step-indicator {
        width: 25px;
        height: 25px;
        font-size: 0.8em;
    }
    
    .step-label {
        font-size: 0.75em;
    }
} 