/* 
 * Advanced Features Styles - Baseado na Odonto Company
 * Estilos para funcionalidades avançadas inspiradas na Odonto Company
 */

/* Chat Widget */
#chat-widget {
    font-family: 'Inter', sans-serif;
}

#chat-bubble {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-chat 2s infinite;
}

@keyframes pulse-chat {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(220, 38, 38, 0);
    }
}

#chat-window {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.quick-reply {
    transition: all 0.2s ease;
}

.quick-reply:hover {
    transform: translateY(-1px);
}

/* Treatment Filter */
.treatment-checkbox {
    accent-color: var(--bdente-red);
}

.treatment-checkbox:checked + span {
    color: var(--bdente-red);
    font-weight: 500;
}

/* Assessment Modal */
.modal-overlay {
    backdrop-filter: blur(5px);
    background: rgba(0, 0, 0, 0.5);
}

.modal-overlay:not(.active) {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.modal-content {
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

/* Assessment Questions */
#assessment-questions input[type="radio"] {
    accent-color: var(--bdente-red);
}

#assessment-questions label:hover {
    background-color: #f9fafb;
    border-radius: 6px;
    padding: 4px 8px;
    margin: -4px -8px;
}

/* Unit Info Card */
.unidade-info-card {
    border-left: 4px solid var(--bdente-red);
    background: linear-gradient(135deg, #fef7f7 0%, #ffffff 100%);
    transition: all 0.3s ease;
}

.unidade-info-card:hover {
    box-shadow: 0 8px 25px -8px rgba(220, 38, 38, 0.3);
    transform: translateY(-2px);
}

/* Location Detection Button */
.location-btn {
    position: relative;
    overflow: hidden;
}

.location-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.location-btn:hover::before {
    width: 200px;
    height: 200px;
}

/* Form Loading States */
.form-field-loading {
    position: relative;
}

.form-field-loading::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid var(--bdente-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 10;
}

.form-field-disabled {
    background-color: #f9fafb;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Notification Improvements */
.notification {
    backdrop-filter: blur(10px);
}

.notification.success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.notification.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.notification.warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.notification.info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

/* Progress Bar Enhancements */
.progress-bar .bg-white {
    animation: progress-fill 0.3s ease-out;
}

@keyframes progress-fill {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

/* Nearby Units Indicator */
.nearby-indicator {
    animation: slide-in-left 0.5s ease-out;
}

@keyframes slide-in-left {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Filter Tags */
.filter-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: var(--bdente-light-red);
    color: var(--bdente-red);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin: 2px;
    transition: all 0.2s ease;
}

.filter-tag:hover {
    background: var(--bdente-red);
    color: white;
    transform: scale(1.05);
}

.filter-tag .remove-tag {
    margin-left: 6px;
    cursor: pointer;
    opacity: 0.7;
}

.filter-tag .remove-tag:hover {
    opacity: 1;
}

/* Unit Distance Indicator */
.distance-indicator {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: #f0f9ff;
    color: #0369a1;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 8px;
}

/* Treatment Icons */
.treatment-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    margin-right: 8px;
}

.treatment-icon.implante {
    background: #fef3c7;
    color: #d97706;
}

.treatment-icon.clareamento {
    background: #f0f9ff;
    color: #0369a1;
}

.treatment-icon.ortodontia {
    background: #f3e8ff;
    color: #7c3aed;
}

.treatment-icon.lente-contato {
    background: #ecfdf5;
    color: #059669;
}

/* Emergency Highlight */
.emergency-unit {
    border: 2px solid #ef4444;
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
    position: relative;
}

.emergency-unit::before {
    content: 'URGÊNCIA';
    position: absolute;
    top: -8px;
    right: 10px;
    background: #ef4444;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    #chat-widget {
        bottom: 20px;
        right: 20px;
    }
    
    #chat-window {
        width: calc(100vw - 40px);
        right: -20px;
    }
    
    .modal-content {
        max-width: calc(100vw - 32px);
        margin: 16px;
    }
    
    .treatment-filter {
        grid-template-columns: 1fr;
    }
    
    .filter-tag {
        font-size: 11px;
        padding: 3px 10px;
    }
}

/* Animation for unit selection */
.unit-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
}

.unit-card:hover {
    border-color: var(--bdente-red);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(220, 38, 38, 0.3);
}

.unit-card.selected {
    border-color: var(--bdente-red);
    background: var(--bdente-light-red);
}

/* Accessibility improvements */
.focus-visible {
    outline: 2px solid var(--bdente-red);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .modal-overlay {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .notification {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    #chat-bubble {
        animation: none;
    }
}