/* CSS for Interactive Elements */

/* Chat Widget */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 300px;
    height: 400px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    transform: translateY(120%);
    transition: transform 0.3s ease;
}

.chat-widget-open {
    transform: translateY(0);
}

.chat-header {
    background: var(--primary);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
}

.chat-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.chat-message {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 10px;
    max-width: 80%;
}

.agent-message {
    background: #f1f1f1;
    align-self: flex-start;
}

.user-message {
    background: var(--primary);
    color: white;
    align-self: flex-end;
}

.chat-form {
    display: flex;
    padding: 10px;
    border-top: 1px solid #eee;
}

.chat-input {
    flex-grow: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 15px;
    margin-right: 10px;
}

.chat-submit {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 15px;
    cursor: pointer;
}

.chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 999;
}

/* Sleep Assessment Quiz */
.quiz-card {
    border: 2px solid var(--primary);
    border-radius: 15px;
    overflow: hidden;
}

.quiz-header {
    background: var(--primary);
    color: white;
    padding: 1.5rem;
}

.quiz-body {
    padding: 2rem;
}

.quiz-question {
    margin-bottom: 1.5rem;
}

.quiz-options label {
    display: block;
    padding: 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-options label:hover {
    background: #f8f9fa;
}

.quiz-options input[type="radio"] {
    margin-right: 10px;
}

.quiz-results {
    display: none;
    padding: 2rem;
    text-align: center;
}

.risk-recommendation {
    display: none;
    margin-top: 1.5rem;
}

/* Appointment Scheduler */
.appointment-form {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.appointment-message {
    display: none;
    margin-top: 1rem;
}

/* Provider Map */
.provider-map {
    position: relative;
    height: 400px;
    background: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
}

.state {
    fill: #ddd;
    stroke: white;
    stroke-width: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.state:hover {
    fill: var(--secondary);
}

.state.active {
    fill: var(--primary);
}

.state-info {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    max-width: 300px;
}

/* Testimonial Carousel */
.testimonial-carousel {
    position: relative;
    padding: 2rem 0;
}

.testimonial-slide {
    display: none;
}

.carousel-controls {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.carousel-prev,
.carousel-next {
    background: var(--primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-prev:hover,
.carousel-next:hover {
    background: var(--secondary);
}

/* Treatment Cost Calculator */
.cost-calculator {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.cost-result {
    display: none;
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--light);
    border-radius: 5px;
    text-align: center;
    font-weight: 600;
    color: var(--primary);
}

/* Sticky Header */
.navbar-scrolled {
    padding: 0.5rem 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Animated Counters */
.counter-container {
    text-align: center;
}

.counter {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

/* Lazy Loading */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img.lazy.loaded {
    opacity: 1;
}

/* Form Validation Styles */
.was-validated .form-control:invalid {
    border-color: var(--danger);
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.was-validated .form-control:valid {
    border-color: var(--success);
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 80%;
    color: var(--danger);
}

.was-validated .form-control:invalid ~ .invalid-feedback {
    display: block;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
