/* Sonoworld Symptom Checker Styles */

.swsc-container {
    --swsc-primary: #0891b2;
    --swsc-secondary: #059669;
    --swsc-accent: #f59e0b;
    --swsc-text: #1f2937;
    --swsc-bg: #f8fafc;
    --swsc-white: #ffffff;
    --swsc-gray-100: #f3f4f6;
    --swsc-gray-200: #e5e7eb;
    --swsc-gray-300: #d1d5db;
    --swsc-gray-400: #9ca3af;
    --swsc-gray-500: #6b7280;
    --swsc-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --swsc-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 600px;
    margin: 0 auto;
    background: var(--swsc-white);
    border-radius: 16px;
    box-shadow: var(--swsc-shadow-lg);
    overflow: hidden;
    border: 1px solid var(--swsc-gray-200);
}

/* Header */
.swsc-header {
    background: linear-gradient(135deg, var(--swsc-primary) 0%, color-mix(in srgb, var(--swsc-primary) 80%, #000) 100%);
    color: var(--swsc-white);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.swsc-header-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.swsc-header-icon svg {
    color: var(--swsc-white);
}

.swsc-header-text h3 {
    margin: 0 0 4px 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--swsc-white);
}

.swsc-header-text p {
    margin: 0;
    font-size: 0.875rem;
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.9);
}

/* Chat Area */
.swsc-chat-area {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: var(--swsc-bg);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.swsc-chat-area::-webkit-scrollbar {
    width: 6px;
}

.swsc-chat-area::-webkit-scrollbar-track {
    background: var(--swsc-gray-100);
}

.swsc-chat-area::-webkit-scrollbar-thumb {
    background: var(--swsc-gray-300);
    border-radius: 3px;
}

/* Messages */
.swsc-message {
    max-width: 85%;
    animation: swsc-fadeIn 0.3s ease-out;
}

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

.swsc-message-user {
    align-self: flex-end;
}

.swsc-message-assistant {
    align-self: flex-start;
}

.swsc-message-content {
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--swsc-text);
}

.swsc-message-user .swsc-message-content {
    background: var(--swsc-primary);
    color: var(--swsc-white);
    border-bottom-right-radius: 4px;
}

.swsc-message-assistant .swsc-message-content {
    background: var(--swsc-white);
    border: 1px solid var(--swsc-gray-200);
    border-bottom-left-radius: 4px;
    box-shadow: var(--swsc-shadow);
}

/* Typing Indicator */
.swsc-typing {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.swsc-typing-dot {
    width: 8px;
    height: 8px;
    background: var(--swsc-gray-400);
    border-radius: 50%;
    animation: swsc-bounce 1.4s ease-in-out infinite both;
}

.swsc-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.swsc-typing-dot:nth-child(2) { animation-delay: -0.16s; }
.swsc-typing-dot:nth-child(3) { animation-delay: 0s; }

@keyframes swsc-bounce {
    0%, 80%, 100% { transform: scale(0.6); }
    40% { transform: scale(1); }
}

/* Recommendation Cards */
.swsc-recommendation {
    margin-top: 16px;
}

.swsc-recommendation h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--swsc-primary);
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--swsc-gray-200);
}

.swsc-scan-card {
    background: var(--swsc-white);
    border: 1px solid var(--swsc-gray-200);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.swsc-scan-card:hover {
    box-shadow: var(--swsc-shadow);
    border-color: var(--swsc-primary);
}

.swsc-scan-card:last-child {
    margin-bottom: 0;
}

.swsc-scan-card h5 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--swsc-text);
    margin: 0 0 8px 0;
}

.swsc-scan-card > p {
    font-size: 0.875rem;
    color: var(--swsc-gray-500);
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.swsc-scan-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Buttons */
.swsc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.swsc-btn-info {
    background: var(--swsc-gray-100);
    color: var(--swsc-text);
    border: 1px solid var(--swsc-gray-300);
}

.swsc-btn-info:hover {
    background: var(--swsc-gray-200);
    color: var(--swsc-text);
    text-decoration: none;
}

.swsc-btn-book {
    background: var(--swsc-secondary);
    color: var(--swsc-white);
}

.swsc-btn-book:hover {
    background: color-mix(in srgb, var(--swsc-secondary) 85%, #000);
    color: var(--swsc-white);
    text-decoration: none;
}

/* Input Area */
.swsc-input-area {
    padding: 16px 20px 20px;
    background: var(--swsc-white);
    border-top: 1px solid var(--swsc-gray-200);
}

.swsc-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.swsc-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--swsc-gray-300);
    border-radius: 12px;
    font-size: 0.9375rem;
    font-family: inherit;
    resize: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-height: 44px;
    max-height: 120px;
    background: var(--swsc-white);
    color: var(--swsc-text);
}

.swsc-input:focus {
    outline: none;
    border-color: var(--swsc-primary);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
}

.swsc-input::placeholder {
    color: var(--swsc-gray-400);
}

.swsc-send-btn {
    width: 44px;
    height: 44px;
    background: var(--swsc-primary);
    color: var(--swsc-white);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.1s ease;
    flex-shrink: 0;
}

.swsc-send-btn:hover {
    background: color-mix(in srgb, var(--swsc-primary) 85%, #000);
}

.swsc-send-btn:active {
    transform: scale(0.95);
}

.swsc-send-btn:disabled {
    background: var(--swsc-gray-300);
    cursor: not-allowed;
}

.swsc-send-btn svg {
    color: var(--swsc-white);
}

/* Disclaimer */
.swsc-disclaimer {
    font-size: 0.75rem;
    color: var(--swsc-gray-500);
    margin: 12px 0 0 0;
    text-align: center;
    line-height: 1.4;
}

/* Quick Question Buttons */
.swsc-quick-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.swsc-quick-btn {
    padding: 8px 14px;
    background: var(--swsc-gray-100);
    border: 1px solid var(--swsc-gray-300);
    border-radius: 20px;
    font-size: 0.8125rem;
    color: var(--swsc-text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.swsc-quick-btn:hover {
    background: var(--swsc-primary);
    color: var(--swsc-white);
    border-color: var(--swsc-primary);
}

/* Urgent Warning */
.swsc-urgent {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 12px;
}

.swsc-urgent p {
    margin: 0;
    color: #991b1b;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.swsc-urgent svg {
    flex-shrink: 0;
}

/* Gender Selection */
.swsc-gender-select {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.swsc-gender-btn {
    flex: 1;
    padding: 12px 16px;
    background: var(--swsc-white);
    border: 2px solid var(--swsc-gray-300);
    border-radius: 10px;
    font-size: 0.9375rem;
    color: var(--swsc-text);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.swsc-gender-btn:hover {
    border-color: var(--swsc-primary);
    background: rgba(8, 145, 178, 0.05);
}

.swsc-gender-btn.active {
    border-color: var(--swsc-primary);
    background: rgba(8, 145, 178, 0.1);
}

/* Loading State */
.swsc-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--swsc-gray-500);
    font-size: 0.875rem;
}

.swsc-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--swsc-gray-300);
    border-top-color: var(--swsc-primary);
    border-radius: 50%;
    animation: swsc-spin 0.8s linear infinite;
}

@keyframes swsc-spin {
    to { transform: rotate(360deg); }
}

/* Error State */
.swsc-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 640px) {
    .swsc-container {
        border-radius: 0;
        max-width: 100%;
        border-left: none;
        border-right: none;
    }

    .swsc-header {
        padding: 16px 20px;
    }

    .swsc-chat-area {
        height: 350px;
        padding: 16px;
    }

    .swsc-message {
        max-width: 90%;
    }

    .swsc-scan-links {
        flex-direction: column;
    }

    .swsc-btn {
        width: 100%;
    }
}

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
    .swsc-container.swsc-dark-mode {
        --swsc-bg: #1f2937;
        --swsc-white: #111827;
        --swsc-text: #f9fafb;
        --swsc-gray-100: #374151;
        --swsc-gray-200: #4b5563;
        --swsc-gray-300: #6b7280;
        --swsc-gray-400: #9ca3af;
        --swsc-gray-500: #d1d5db;
    }
}

/* Print styles */
@media print {
    .swsc-container {
        box-shadow: none;
        border: 1px solid #000;
    }

    .swsc-input-area {
        display: none;
    }
}
