/* Clinical Question Search Widget Styles */
.clinical-question-search-widget {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    border-radius: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Heading Styles */
.clinical-search-heading {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.clinical-search-heading::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: #3498db;
    border-radius: 2px;
}

.heading-emoji {
    font-size: 2rem;
}

/* Search Wrapper */
.clinical-search-wrapper {
    position: relative;
    margin-bottom: 1rem;
    z-index: 1;
    overflow: visible;
}

/* Search Container */
.clinical-search-container {
    position: relative;
    overflow: visible;
}

.clinical-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    padding: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: visible;
}

.clinical-search-input-wrapper:focus-within {
    border-color: #3498db;
    box-shadow: 0 4px 20px rgba(52, 152, 219, 0.2);
}

.clinical-search-input-icon {
    padding: 0 15px;
    color: #7f8c8d;
    font-size: 1.1rem;
}

.clinical-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 15px 10px;
    font-size: 1rem;
    background: transparent;
    color: #2c3e50;
}

.clinical-search-input::placeholder {
    color: #95a5a6;
    font-style: italic;
    transition: all 0.5s ease;
}

/* Looping questions placeholder animation */
.clinical-search-input[data-looping="true"] {
    position: relative;
    overflow: hidden;
}

.clinical-search-input[data-looping="true"]::placeholder {
    transition: all 0.5s ease;
    opacity: 1;
}

/* Looping question animation container */
.looping-question-container {
    position: absolute;
    top: 50%;
    left: 40px; /* Default offset for search icon */
    right: 0;
    transform: translateY(-50%);
    overflow: hidden;
    height: 1.2em;
    display: block;
    width: calc(100% - 40px); /* Adjust width based on left offset */
    pointer-events: none;
    z-index: 1;
    font-size: inherit;
    font-family: inherit;
    color: #95a5a6;
    font-style: italic;
    /* Padding and left offset will be controlled by Elementor controls */
}

.looping-question-item {
    position: absolute;
    top: 0;
    left: 0; /* Will be overridden by Elementor control */
    width: 100%; /* Will be overridden by Elementor control */
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Padding and positioning will be controlled by Elementor controls */
}

.looping-question-item.active {
    opacity: 1;
    transform: translateY(0);
}

.looping-question-item.fade-out {
    opacity: 0;
    transform: translateY(-20px);
}

.looping-question-item.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Animation keyframes for looping questions */
@keyframes questionSlideUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes questionSlideDown {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px);
    }
}

@keyframes questionFadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes questionFadeOut {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.clinical-search-send-btn {
    background: #f8f9fa;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #7f8c8d;
    margin-right: 5px;
}

.clinical-search-send-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.clinical-search-send-btn svg path {
    fill: currentColor;
}

.clinical-search-send-btn i {
    font-size: 24px;
    color: currentColor;
}

.clinical-search-send-btn:hover {
    background: #3498db;
    color: #ffffff;
}

/* Inactive State (no text input) */
.clinical-search-send-btn:not(.active) {
    background: #f8f9fa;
    color: #6c757d;
    opacity: 0.6;
    cursor: not-allowed;
}

.clinical-search-send-btn:not(.active):hover {
    background: #f8f9fa;
    color: #6c757d;
    transform: none;
}

/* Active State (with text input) */
.clinical-search-send-btn.active {
    background: #007bff;
    color: #ffffff;
    opacity: 1;
    cursor: pointer;
}

.clinical-search-send-btn.active:hover {
    background: #0056b3;
}

/* Terms and Conditions */
.clinical-search-terms {
    text-align: center;
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.clinical-search-terms p {
    display: inline;
    margin: 0;
    padding: 0;
}

.clinical-search-terms i {
    color: #95a5a6;
    display: inline;
    vertical-align: baseline;
    position: relative;
    transition: top 0.3s ease;
}

.clinical-search-terms svg {
    display: inline;
    vertical-align: baseline;
    position: relative;
    transition: top 0.3s ease;
}

/* Modules Grid */
.clinical-modules-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 2rem;
    position: relative;
    z-index: 0;
}

/* Module Grid Alignment Classes */
.elementor-modules-grid-align-left .clinical-modules-grid {
    margin-left: 0;
    margin-right: auto;
}

.elementor-modules-grid-align-center .clinical-modules-grid {
    margin-left: auto;
    margin-right: auto;
}

.elementor-modules-grid-align-right .clinical-modules-grid {
    margin-left: auto;
    margin-right: 0;
}

.clinical-module-pill {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    font-size: 0.8125rem;
    white-space: nowrap;
}

.clinical-module-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    border-color: #3498db;
}

.module-icon {
    font-size: 1.5rem;
    color: #2c3e50;
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;    
}

.module-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: currentColor;
}

.module-icon svg path {
    fill: currentColor;
}

.module-icon i {
    font-size: 1.5rem;
    color: currentColor;
}

.module-title {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.8125rem;
}

/* Suggested Questions */
.clinical-suggested-questions {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}

.suggested-questions-content {
    display: flex;
    flex-direction: column;
}

.clinical-suggested-question {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #495057;
    font-size: 0.95rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.clinical-suggested-question .question-content {
    flex: 1;
}

.clinical-suggested-question .question-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    transition: all 0.3s ease;
}

.clinical-suggested-question .question-arrow svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

.clinical-suggested-question .question-arrow svg path {
    fill: currentColor;
}

.clinical-suggested-question .question-arrow i {
    font-size: 12px;
    color: currentColor;
}

.clinical-suggested-question:last-child {
    margin-bottom: 0;
}

.clinical-suggested-question:hover {
    background: #e3f2fd;
    border-color: #3498db;
    color: #2c3e50;
}

/* Mobile Reverse Order */
@media (max-width: 768px) {
    .clinical-question-search-widget.mobile-reverse-order {
        display: flex;
        flex-direction: column;
    }
    
    .clinical-question-search-widget.mobile-reverse-order .clinical-modules-grid {
        order: 1;
        margin-bottom: 1rem;
    }
    
    .clinical-question-search-widget.mobile-reverse-order .clinical-search-wrapper {
        order: 2;
        margin-bottom: 0;
    }
    
    .clinical-question-search-widget.mobile-reverse-order .clinical-search-terms {
        order: 3;
    }
    
    .clinical-question-search-widget.mobile-reverse-order .clinical-suggested-questions {
        /* Dynamic positioning will be handled by JavaScript */
        bottom: auto;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .clinical-question-search-widget {
        padding: 15px;
    }
    
    .clinical-search-heading {
        font-size: 2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .clinical-modules-grid {
        gap: 12px;
    }
    
    .clinical-module-pill {
        padding: 8px 10px;
        font-size: 0.75rem;
    }
    
    .module-icon {
        font-size: 1.3rem;
    }
    
    .module-title {
        font-size: 0.75rem;
    }
    
    .clinical-suggested-questions {
        max-height: 300px;
        margin-top: 5px;
    }
}

@media (max-width: 480px) {
    .clinical-search-heading {
        font-size: 1.5rem;
    }
    
    .clinical-search-input-wrapper {
        padding: 3px;
    }
    
    .clinical-search-input {
        padding: 12px 8px;
        font-size: 0.9rem;
    }
    
    .clinical-search-send-btn {
        width: 40px;
        height: 40px;
    }
    
    .clinical-module-pill {
        padding: 8px 10px;
        gap: 10px;
        font-size: 0.7rem;
    }
    
    .module-icon {
        font-size: 1.2rem;
    }
    
    .module-title {
        font-size: 0.7rem;
    }
    
    .clinical-suggested-questions {
        max-height: 250px;
        margin-top: 5px;
        padding: 15px;
    }
}

/* Animation for suggested questions */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.clinical-suggested-questions.show {
    animation: fadeInDown 0.3s ease-out;
}

/* Loading state */
.clinical-search-send-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.clinical-search-send-btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Country Dropdown Styles */
.clinical-country-dropdown {
    position: relative;
    display: inline-block;
}

.clinical-country-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #7f8c8d;
    font-size: 0.9rem;
    min-width: 60px;
    justify-content: center;
}

.clinical-country-dropdown-btn:hover,
.clinical-country-dropdown-btn:active,
.clinical-country-dropdown-btn:focus {
    background: #E4F0F0;
    border-color: #3498db;
    color: #3498db;
}

.clinical-country-dropdown-btn[aria-expanded="true"] {
    background: #f8f9fa;
    border-color: #3498db;
    color: #3498db;
}

.clinical-country-dropdown-btn.country-selected {
    padding: 10px;
    border: none;
    border-color: #3498db;
    color: #3498db;
}

.clinical-country-dropdown .clinical-country-map-icon,
.clinical-country-dropdown-btn .clinical-country-map-icon,
.clinical-country-dropdown-item .clinical-country-map-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem !important;
    height: 1.5rem !important;
    border-radius: 100px;
    overflow: hidden;
    flex-shrink: 0;
}

.clinical-country-dropdown .clinical-country-map-icon svg,
.clinical-country-dropdown-btn .clinical-country-map-icon svg,
.clinical-country-dropdown-item .clinical-country-map-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.clinical-country-dropdown .clinical-country-map-icon img,
.clinical-country-dropdown-btn .clinical-country-map-icon img,
.clinical-country-dropdown-item .clinical-country-map-icon img {
    width: 1.5rem !important;
    height: 1.5rem !important;
    display: block;
    object-fit: cover!important;
}

.clinical-country-dropdown-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    margin-left: auto;
}

.clinical-country-dropdown-arrow svg {
    width: 22px;
    height: 22px;
}

.clinical-country-dropdown-btn[aria-expanded="true"] .clinical-country-dropdown-arrow {
    transform: rotate(180deg);
}

.clinical-country-dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 2px;
    min-width: 200px;
}

.clinical-country-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f5f5f5;
    color: #2c3e50;
    font-size: 0.9rem;
}

.clinical-country-dropdown-item:last-child {
    border-bottom: none;
}

.clinical-country-dropdown-item:hover {
    background: #f8f9fa;
    color: #3498db;
}

.clinical-country-dropdown-item .clinical-country-map-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.clinical-country-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Country dropdown positioning adjustments for search input */
.clinical-search-input-wrapper .clinical-country-dropdown {
    padding: 0;
}

/* Mobile responsive adjustments for country dropdown */
@media (max-width: 768px) {
    .clinical-country-dropdown-btn {
        padding: 6px 10px;
        min-width: 50px;
        gap: 6px;
    }
    
    .clinical-country-dropdown .clinical-country-map-icon,
    .clinical-country-dropdown-btn .clinical-country-map-icon {
        width: 1.5rem !important;
        height: 1.5rem !important;
    }
    
    .clinical-country-dropdown .clinical-country-map-icon img,
    .clinical-country-dropdown-btn .clinical-country-map-icon img {
        width: 1.5rem !important;
        height: 1.5rem !important;
    }
    
    .clinical-country-dropdown-list {
        min-width: 180px;
        max-height: 150px;
    }
    
    .clinical-country-dropdown-item {
        padding: 10px 12px;
        font-size: 0.85rem;
        gap: 10px;
    }
    
    .clinical-country-dropdown-item .clinical-country-map-icon {
        width: 1.25rem !important;
        height: 1.25rem !important;
    }
    
    .clinical-country-dropdown-item .clinical-country-map-icon img {
        width: 1.25rem !important;
        height: 1.25rem !important;
    }
}

@media (max-width: 480px) {
    .clinical-country-dropdown-btn {
        padding: 4px 8px;
        min-width: 45px;
        gap: 4px;
    }
    
    .clinical-country-dropdown .clinical-country-map-icon,
    .clinical-country-dropdown-btn .clinical-country-map-icon {
        width: 1.25rem !important;
        height: 1.25rem !important;
    }
    
    .clinical-country-dropdown .clinical-country-map-icon img,
    .clinical-country-dropdown-btn .clinical-country-map-icon img {
        width: 1.25rem !important;
        height: 1.25rem !important;
    }
    
    .clinical-country-dropdown-list {
        min-width: 160px;
        max-height: 120px;
    }
    
    .clinical-country-dropdown-item {
        padding: 8px 10px;
        font-size: 0.8rem;
        gap: 8px;
    }
    
    .clinical-country-dropdown-item .clinical-country-map-icon {
        width: 1rem !important;
        height: 1rem !important;
    }
    
    .clinical-country-dropdown-item .clinical-country-map-icon img {
        width: 1rem !important;
        height: 1rem !important;
    }
}
