/**
 * WP Care Studio Engage - Frontend Styles
 */

/* CSS Variables (defaults - overridden by inline styles) */
:root {
    --wpcs-primary: #2563eb;
    --wpcs-secondary: #1e40af;
    --wpcs-text: #ffffff;
    --wpcs-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --wpcs-radius: 12px;
    --wpcs-radius-sm: 8px;
}

/* Reset for widget elements */
.wpcs-widget,
.wpcs-widget *,
.wpcs-bar,
.wpcs-bar * {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Hidden utility */
.wpcs-hidden {
    display: none !important;
}

/* Screen reader only - visually hidden but accessible */
.wpcs-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ========================================
   MAIN WIDGET CONTAINER
   ======================================== */

.wpcs-widget {
    position: fixed;
    bottom: 20px;
    z-index: 999999;
    font-size: 14px;
    line-height: 1.4;
}

.wpcs-widget.wpcs-position-right {
    right: 20px;
}

.wpcs-widget.wpcs-position-left {
    left: 20px;
}

/* ========================================
   TOGGLE BUTTON
   ======================================== */

.wpcs-toggle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: var(--wpcs-primary) !important;
    border: none !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--wpcs-shadow);
    transition: transform 0.2s ease, background-color 0.2s ease;
    position: relative;
    padding: 0;
    overflow: visible;
    /* Reset for theme compatibility */
    border-color: transparent !important;
    outline: none;
}

.wpcs-toggle:hover,
.wpcs-toggle:focus {
    transform: scale(1.05);
    filter: brightness(1.1);
    background: var(--wpcs-primary) !important;
    border: none !important;
    border-color: transparent !important;
}

.wpcs-toggle:active {
    transform: scale(0.95);
}

/* Notification badge - positioned outside the circle like HelloBox */
.wpcs-notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    background: #ef4444;
    border-radius: 10px;
    border: 2px solid #fff;
    z-index: 15;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    animation: wpcs-badge-pulse 2s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

@keyframes wpcs-badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.wpcs-toggle-icon {
    color: var(--wpcs-text);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wpcs-toggle-icon svg {
    width: 32px;
    height: 32px;
}

/* Profile Avatar in Toggle */
.wpcs-toggle-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
}

.wpcs-toggle-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* External chat bubble for typing indicator */
.wpcs-typing-bubble {
    position: absolute;
    bottom: 50px;
    right: 75px;
    background: #ffffff;
    border-radius: 18px 18px 4px 18px;
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
    align-items: center;
    gap: 5px;
    z-index: 5;
    animation: wpcs-bubble-pop 0.3s ease-out;
}

.wpcs-widget.wpcs-position-left .wpcs-typing-bubble {
    right: auto;
    left: 75px;
    border-radius: 18px 18px 18px 4px;
}

@keyframes wpcs-bubble-pop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.wpcs-typing-bubble.wpcs-visible {
    display: flex;
}

.wpcs-typing-bubble span {
    width: 8px;
    height: 8px;
    background: var(--wpcs-primary);
    border-radius: 50%;
    animation: wpcs-typing-bounce 1.4s infinite ease-in-out both;
}

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

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

/* Old internal typing - hidden */
.wpcs-toggle-typing {
    display: none;
}

/* ========================================
   CHAT BUBBLE PROMPT
   ======================================== */

.wpcs-prompt-bubble {
    position: absolute;
    bottom: 85px;
    background: #ffffff;
    border-radius: 18px;
    box-shadow: var(--wpcs-shadow);
    padding: 14px 38px 14px 18px;
    width: 340px;
    max-width: calc(100vw - 40px);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wpcs-prompt-bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.18);
}

.wpcs-position-right .wpcs-prompt-bubble {
    right: 0;
}

.wpcs-position-left .wpcs-prompt-bubble {
    left: 0;
}

.wpcs-prompt-text {
    font-size: 14px;
    color: #1f2937;
    line-height: 1.5;
    font-weight: 500;
}

.wpcs-prompt-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.wpcs-prompt-close:hover {
    background: #f3f4f6;
    color: #6b7280;
}

/* Speech bubble tail */
.wpcs-prompt-tail {
    position: absolute;
    bottom: -8px;
    width: 16px;
    height: 16px;
    background: #ffffff;
    transform: rotate(45deg);
    box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.05);
}

.wpcs-position-right .wpcs-prompt-tail {
    right: 22px;
}

.wpcs-position-left .wpcs-prompt-tail {
    left: 22px;
}

/* Prompt bubble animations */
.wpcs-prompt-bubble.wpcs-fade-in {
    animation: wpcs-prompt-in 0.4s ease;
}

@keyframes wpcs-prompt-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.wpcs-prompt-bubble.wpcs-fade-out {
    animation: wpcs-prompt-out 0.3s ease forwards;
}

@keyframes wpcs-prompt-out {
    to {
        opacity: 0;
        transform: translateY(-5px) scale(0.95);
    }
}

/* ========================================
   MAIN PANEL
   ======================================== */

.wpcs-panel {
    position: absolute;
    bottom: 85px;
    width: 340px;
    max-width: calc(100vw - 40px);
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: var(--wpcs-radius);
    box-shadow: var(--wpcs-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: wpcs-slide-up 0.3s ease;
}

.wpcs-position-right .wpcs-panel {
    right: 0;
}

.wpcs-position-left .wpcs-panel {
    left: 0;
}

@keyframes wpcs-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Panel Header */
.wpcs-panel-header {
    background: #4b5563;
    color: #ffffff;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wpcs-header-save {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.wpcs-header-save:hover {
    opacity: 0.8;
}

.wpcs-header-save svg {
    opacity: 0.9;
}

.wpcs-panel-title {
    font-size: 16px;
    font-weight: 600;
    flex: 1;
    padding-right: 10px;
}

.wpcs-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    margin-left: auto;
}

.wpcs-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Mobile Close Button - thumb-friendly at bottom */
.wpcs-close-mobile {
    display: none; /* Hidden by default, shown on mobile via media query */
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 auto;
}

.wpcs-close-mobile:hover {
    background: #e5e7eb;
}

.wpcs-close-mobile svg {
    width: 16px;
    height: 16px;
}

/* Powered By Branding Bar */
.wpcs-powered-by {
    background: #f3f4f6;
    color: #6b7280;
    padding: 8px 16px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-bottom: 1px solid #e5e7eb;
}

.wpcs-powered-by svg {
    opacity: 0.7;
    color: #9ca3af;
}

.wpcs-powered-by strong {
    font-weight: 600;
    color: #4b5563;
}

/* Panel Body */
.wpcs-panel-body {
    padding: 0;
    flex: 1;
    min-height: 0; /* Allow flex to shrink below content size */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* ========================================
   CHAT AREA - Typing indicators & messages
   ======================================== */

.wpcs-chat-area {
    padding: 16px;
    background: #f9fafb;
    min-height: 200px;
}

/* Chat Row - Avatar + Message layout */
.wpcs-chat-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    animation: wpcs-message-in 0.3s ease;
}

.wpcs-chat-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
}

.wpcs-chat-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.wpcs-chat-avatar .wpcs-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--wpcs-primary);
}

/* Typing Indicator */
.wpcs-typing-indicator {
    display: inline-flex;
    align-items: center;
    background: #e5e7eb;
    padding: 12px 16px;
    border-radius: 18px;
}

.wpcs-typing-dots {
    display: flex;
    gap: 4px;
}

.wpcs-typing-dots span {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: wpcs-typing-bounce 1.4s infinite ease-in-out both;
}

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

/* Chat Message Bubbles */
.wpcs-chat-message {
    animation: wpcs-message-in 0.3s ease;
}

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

.wpcs-message-bubble {
    flex: 1;
    background: #ffffff;
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.wpcs-options-content {
    flex: 1;
}

.wpcs-message-text {
    color: #1f2937;
    font-size: 15px;
    line-height: 1.5;
    margin: 0 0 12px 0;
}

.wpcs-cta-button {
    display: block;
    background: var(--wpcs-primary);
    color: var(--wpcs-text);
    text-align: center;
    padding: 12px 20px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.wpcs-cta-button:hover {
    filter: brightness(1.15);
    transform: scale(1.02);
    color: var(--wpcs-text) !important;
}

/* ========================================
   CONTACT OPTIONS - 2 Column Grid
   ======================================== */

.wpcs-options {
    padding: 0;
}

.wpcs-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 0;
}

.wpcs-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 8px;
    text-decoration: none;
    color: #1f2937;
    border: none;
    background: #ffffff;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    font-size: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.wpcs-option:hover {
    background: color-mix(in srgb, var(--wpcs-primary) 10%, white);
    transform: translateY(-1px);
}

.wpcs-option:hover .wpcs-option-icon {
    filter: brightness(1.15);
}

.wpcs-option-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--wpcs-primary);
    color: var(--wpcs-text);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.wpcs-option-icon svg {
    width: 22px;
    height: 22px;
}

.wpcs-option-label {
    font-weight: 600;
    font-size: 13px;
    display: block;
    color: #1f2937;
    text-align: center;
}

.wpcs-option-detail {
    font-size: 12px;
    color: #6b7280;
    display: block;
    margin-top: 2px;
}

/* Directions Link - Full width, different style */
.wpcs-directions-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    margin-top: 8px;
    background: transparent;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    color: #6b7280;
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
}

.wpcs-directions-link:hover {
    background: #f9fafb;
    border-color: var(--wpcs-primary);
    color: var(--wpcs-primary);
}

.wpcs-directions-link:visited {
    color: #6b7280;
}

.wpcs-directions-link:visited:hover {
    color: var(--wpcs-primary);
}

.wpcs-directions-link svg {
    width: 16px;
    height: 16px;
}

/* ========================================
   RESUME CHAT BANNER
   ======================================== */

.wpcs-resume-chat-banner {
    padding: 0 0 12px 0;
}

.wpcs-resume-chat-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: color-mix(in srgb, var(--wpcs-accent, #4f46e5) 10%, white);
    border: 2px solid var(--wpcs-accent, #4f46e5);
    border-radius: 10px;
    color: var(--wpcs-accent, #4f46e5);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wpcs-resume-chat-btn:hover {
    background: color-mix(in srgb, var(--wpcs-accent, #4f46e5) 20%, white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--wpcs-accent, #4f46e5) 30%, transparent);
}

.wpcs-resume-icon {
    display: flex;
    align-items: center;
}

.wpcs-resume-icon svg {
    width: 16px;
    height: 16px;
    fill: var(--wpcs-accent, #4f46e5);
}

.wpcs-resume-text {
    flex: 1;
    text-align: left;
}

.wpcs-resume-arrow {
    font-size: 14px;
    transition: transform 0.2s ease;
}

.wpcs-resume-chat-btn:hover .wpcs-resume-arrow {
    transform: translateX(3px);
}

/* ========================================
   CALLBACK FORM
   ======================================== */

.wpcs-callback-form {
    padding: 16px 20px;
}

.wpcs-form-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    font-weight: 600;
    color: #1f2937;
}

.wpcs-back {
    background: none !important;
    background-color: transparent !important;
    border: none;
    color: var(--wpcs-primary);
    cursor: pointer;
    padding: 0;
    margin-right: 12px;
    font-size: 14px;
}

.wpcs-back:hover,
.wpcs-back:focus,
.wpcs-back:active {
    background: none !important;
    background-color: transparent !important;
    text-decoration: underline;
    outline: none;
}

.wpcs-form-group {
    margin-bottom: 12px;
}

.wpcs-form-group input,
.wpcs-form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: var(--wpcs-radius-sm);
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wpcs-form-group input:focus,
.wpcs-form-group textarea:focus {
    outline: none;
    border-color: var(--wpcs-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.wpcs-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.wpcs-submit {
    width: 100%;
    padding: 14px 20px;
    background: var(--wpcs-primary);
    color: #fff;
    border: none;
    border-radius: var(--wpcs-radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.15s, transform 0.15s;
}

.wpcs-submit:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
}

.wpcs-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Callback Success */
.wpcs-callback-success {
    text-align: center;
    padding: 30px 20px;
}

.wpcs-success-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #10b981;
    color: white;
    font-size: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.wpcs-callback-success p {
    color: #1f2937;
    font-size: 16px;
    margin: 0;
}

/* ========================================
   PANEL FOOTER - BUSINESS HOURS
   ======================================== */

.wpcs-panel-footer {
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    padding: 0;
    position: relative;
}

/* Footer bar with status and toggle side by side */
.wpcs-footer-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    gap: 8px;
}

/* Left section wrapper */
.wpcs-footer-left {
    display: flex;
    align-items: center;
    flex: 1;
}

/* Left: Hours button (clickable) */
.wpcs-footer-hours {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    background: none;
    border: none;
    padding: 4px 8px;
    margin: -4px -8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 12px;
    font-weight: 500;
    color: var(--wpcs-primary, #4f46e5);
}

.wpcs-footer-hours:hover {
    background: rgba(0, 0, 0, 0.05);
}

.wpcs-footer-hours:focus,
.wpcs-footer-hours:active {
    outline: none;
    background: rgba(0, 0, 0, 0.08);
    box-shadow: 0 0 0 2px var(--wpcs-primary, #4f46e5);
}

.wpcs-footer-clock-icon {
    flex-shrink: 0;
}

.wpcs-footer-hours:has(.wpcs-status-open) .wpcs-footer-clock-icon {
    color: #10b981;
}

.wpcs-footer-hours:has(.wpcs-status-closed) .wpcs-footer-clock-icon {
    color: #ef4444;
}

.wpcs-footer-status {
    font-weight: 600;
}

.wpcs-footer-status.wpcs-status-open {
    color: #10b981;
}

.wpcs-footer-status.wpcs-status-closed {
    color: #ef4444;
}

.wpcs-footer-spacer {
    flex: 1;
}

/* Center: Privacy notice */
.wpcs-footer-privacy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: relative;
    cursor: help;
    flex: 1;
}

.wpcs-footer-shield-icon {
    flex-shrink: 0;
}

.wpcs-footer-privacy-text {
    font-size: 11px;
    color: #dc3545;
    font-weight: 500;
    white-space: nowrap;
}

.wpcs-footer-privacy-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    padding: 8px 12px;
    background: #333;
    color: white;
    font-size: 12px;
    line-height: 1.3;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
    z-index: 10;
}

.wpcs-footer-privacy-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
}

.wpcs-footer-privacy:hover .wpcs-footer-privacy-tooltip,
.wpcs-footer-privacy-tooltip.wpcs-tooltip-visible {
    opacity: 1;
    visibility: visible;
}

/* Right: Map link and close button */
.wpcs-footer-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.wpcs-footer-map {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--wpcs-primary, #4f46e5);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: opacity 0.15s;
}

.wpcs-footer-map:hover {
    opacity: 0.8;
}

.wpcs-footer-map:focus,
.wpcs-footer-map:active {
    outline: none;
    opacity: 0.8;
    box-shadow: 0 0 0 2px var(--wpcs-primary, #4f46e5);
    border-radius: 4px;
}

.wpcs-footer-map:visited {
    color: var(--wpcs-primary, #4f46e5);
}

.wpcs-footer-route-icon {
    flex-shrink: 0;
}

/* Legacy styles for backwards compatibility */
.wpcs-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 8px;
}

.wpcs-status-open .wpcs-status-dot {
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.wpcs-status-closed .wpcs-status-dot {
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* Hours dropdown expands above the footer bar */
.wpcs-hours-dropdown {
    padding: 12px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.wpcs-hours-dropdown.wpcs-hours-dropdown-above {
    /* This class ensures proper styling when dropdown is above */
    border-top: none;
    margin-top: 0;
}

.wpcs-hours-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 12px;
}

.wpcs-hours-day {
    color: #6b7280;
}

.wpcs-hours-time {
    color: #1f2937;
}

/* ========================================
   SAVE CONTACT
   ======================================== */

.wpcs-save-contact {
    border-top: 1px solid #e5e7eb;
    padding: 12px 20px;
    text-align: center;
}

.wpcs-save-contact-btn {
    display: inline-flex;
    align-items: center;
    color: var(--wpcs-primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.wpcs-save-contact-btn svg {
    margin-right: 6px;
}

.wpcs-save-contact-btn:hover {
    text-decoration: underline;
}

/* ========================================
   SOCIAL PROOF NOTIFICATION
   ======================================== */

.wpcs-social-proof {
    position: absolute;
    bottom: 85px;
    background: #ffffff;
    border-radius: var(--wpcs-radius);
    box-shadow: var(--wpcs-shadow);
    padding: 14px 18px;
    width: 340px;
    max-width: calc(100vw - 40px);
    animation: wpcs-social-proof-in 0.4s ease;
}

.wpcs-position-right .wpcs-social-proof {
    right: 0;
}

.wpcs-position-left .wpcs-social-proof {
    left: 0;
}

@keyframes wpcs-social-proof-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.wpcs-social-proof.wpcs-fade-out {
    animation: wpcs-social-proof-out 0.3s ease forwards;
}

@keyframes wpcs-social-proof-out {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.wpcs-social-proof-content {
    display: flex;
    align-items: flex-start;
}

.wpcs-social-proof-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #10b981;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
    font-size: 12px;
}

#wpcs-social-proof-text {
    font-size: 13px;
    color: #1f2937;
    line-height: 1.5;
}

/* Verified by badge */
.wpcs-social-proof-verified {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e5e7eb;
    font-size: 11px;
    color: #6b7280;
}

.wpcs-social-proof-verified svg {
    color: #10b981;
}

.wpcs-social-proof-verified strong {
    color: #374151;
    font-weight: 600;
}

/* ========================================
   BOTTOM CONTACT BAR
   ======================================== */

.wpcs-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--wpcs-primary);
    color: var(--wpcs-text);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999998;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.wpcs-bar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: nowrap;
    max-width: 900px;
}

.wpcs-bar-status {
    display: flex;
    align-items: center;
    font-size: 13px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
}

.wpcs-bar-status .wpcs-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}

.wpcs-bar-status.wpcs-status-open .wpcs-status-dot {
    background: #4ade80;
}

.wpcs-bar-status.wpcs-status-closed .wpcs-status-dot {
    background: #fca5a5;
}

/* Bar Hours Wrapper with Dropdown */
.wpcs-bar-hours-wrapper {
    position: relative;
}

.wpcs-bar-hours-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none !important;
    background-color: transparent !important;
    border: none;
    cursor: pointer;
    padding: 0;
    color: inherit;
    font-family: inherit;
}

.wpcs-bar-hours-toggle:hover,
.wpcs-bar-hours-toggle:focus,
.wpcs-bar-hours-toggle:active {
    background: none !important;
    background-color: transparent !important;
    color: inherit !important;
    outline: none;
}

.wpcs-bar-today-hours {
    font-size: 12px;
    opacity: 0.9;
}

.wpcs-bar-hours-arrow {
    font-size: 10px;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.wpcs-bar-hours-toggle.active .wpcs-bar-hours-arrow {
    transform: rotate(180deg);
}

.wpcs-bar-hours-dropdown {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 12px 16px;
    margin-bottom: 10px;
    min-width: 180px;
    z-index: 10;
}

.wpcs-bar-hours-dropdown .wpcs-hours-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
    color: #374151;
}

.wpcs-bar-hours-dropdown .wpcs-hours-day {
    font-weight: 500;
    color: #1f2937;
}

.wpcs-bar-hours-dropdown .wpcs-hours-time {
    color: #6b7280;
}

.wpcs-bar-actions {
    display: flex;
    gap: 8px;
}

.wpcs-bar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.15);
    color: var(--wpcs-text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.wpcs-bar-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: var(--wpcs-text) !important;
}

.wpcs-bar-btn svg {
    width: 16px;
    height: 16px;
}

.wpcs-bar-main {
    background: var(--wpcs-text);
    color: var(--wpcs-primary);
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wpcs-bar-main:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Contact bar visibility states (scroll-triggered) */
.wpcs-bar {
    transition: transform 0.4s ease, opacity 0.3s ease;
}

.wpcs-bar.wpcs-bar-hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

.wpcs-bar.wpcs-bar-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* Adjust widget position when bar is visible */
.wpcs-bar:not(.wpcs-bar-hidden) ~ .wpcs-widget {
    bottom: 70px;
}

/* Don't adjust widget when bar is hidden */
.wpcs-bar.wpcs-bar-hidden ~ .wpcs-widget {
    bottom: 20px;
}

/* ========================================
   MOBILE RESPONSIVE
   ======================================== */

/* Hide bottom bar on mobile/tablet - it's designed for desktop only */
@media screen and (max-width: 768px) {
    .wpcs-bar,
    div.wpcs-bar,
    body .wpcs-bar,
    #wpcs-bar,
    body #wpcs-bar {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
        pointer-events: none !important;
    }
}

/* ========================================
   MOBILE FULL-SCREEN CHAT EXPERIENCE
   ======================================== */
@media (max-width: 768px) {
    
    /* Full-screen panel on mobile */
    .wpcs-widget.active .wpcs-panel {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh; /* Fallback for older browsers */
        height: 100dvh; /* Dynamic viewport height - accounts for mobile browser UI */
        max-width: 100vw;
        max-height: 100vh; /* Fallback */
        max-height: 100dvh;
        border-radius: 0;
        z-index: 999999;
    }
    
    /* Hide toggle bubble when chat is open */
    .wpcs-widget.active .wpcs-toggle {
        display: none !important;
    }
    
    /* Hide header close button on mobile - use footer close instead */
    .wpcs-panel-header .wpcs-close {
        display: none;
    }
    
    /* Ensure chat area fills available space */
    .wpcs-panel-body {
        flex: 1;
        overflow-y: auto;
    }
    
    /* Hide powered-by header on mobile to save space */
    .wpcs-powered-by {
        display: none !important;
    }
    
    /* Hide powered-by in AI chat header on mobile (save contact bar remains) */
    .wpcs-ai-chat-container .wpcs-powered-by {
        display: none !important;
    }
    
    /* Hide subscreen header back buttons on mobile - use footer button instead */
    .wpcs-subscreen-header .wpcs-back {
        display: none !important;
    }
    
    /* Mobile footer adjustments */
    .wpcs-panel-footer {
        padding-bottom: 12px;
        /* Safe area for devices with home indicator */
        padding-bottom: max(12px, env(safe-area-inset-bottom));
    }
    
    /* Mobile footer bar - 4-column layout */
    .wpcs-footer-bar {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 0;
        padding: 10px 12px;
    }
    
    /* Left section - hours status, left-aligned */
    .wpcs-footer-left {
        flex: 1 1 25%;
        justify-content: flex-start;
    }
    
    /* Hours button on mobile - larger tap target */
    .wpcs-footer-hours {
        flex: 0 0 auto;
        justify-content: flex-start;
        font-size: 13px;
        padding: 10px 12px;
        margin: -10px -12px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    /* Privacy notice on mobile - centered */
    .wpcs-footer-privacy {
        flex: 1 1 50%;
        justify-content: center;
        padding: 0 4px;
    }
    
    .wpcs-footer-privacy-text {
        font-size: 10px;
    }
    
    .wpcs-footer-privacy-tooltip {
        white-space: normal;
        max-width: 180px;
        text-align: center;
        left: auto;
        right: 0;
        transform: none;
    }
    
    .wpcs-footer-privacy-tooltip::after {
        left: auto;
        right: 20px;
        transform: none;
    }
    
    /* Right section - Map and close grouped, right-aligned */
    .wpcs-footer-right {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
    }
    
    /* Map link - larger tap target */
    .wpcs-footer-map {
        font-size: 13px;
        padding: 10px 12px;
        margin: -10px -12px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    /* Circular close button */
    .wpcs-close-mobile {
        display: flex !important;
        width: 36px !important;
        height: 36px !important;
        min-width: 36px;
        padding: 0 !important;
        border-radius: 50% !important;
        background: #ffffff !important;
        border: 1px solid #d1d5db !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0;
    }
    
    .wpcs-close-mobile svg {
        width: 22px !important;
        height: 22px !important;
        color: #6b7280;
    }
    
    /* Back arrow mode - highlight with accent color */
    .wpcs-close-mobile.wpcs-back-mode {
        background: #3b82f6 !important;
        border-color: #3b82f6 !important;
    }
    
    .wpcs-close-mobile.wpcs-back-mode svg {
        color: #ffffff;
    }
    
    /* Contact card phone number styling */
    .wpcs-card-instruction {
        margin: 0 0 8px 0;
        font-size: 14px;
        color: #374151;
    }
    
    .wpcs-card-phone-number {
        display: block;
        font-size: 22px;
        font-weight: 600;
        color: #1e3a5f;
        text-decoration: none;
        letter-spacing: 0.5px;
    }
    
    .wpcs-card-phone-number:hover {
        color: var(--wpcs-primary);
    }
    
    /* All action buttons full width on mobile */
    .wpcs-engage-card-action {
        display: flex !important;
        width: 100% !important;
        justify-content: center !important;
        box-sizing: border-box;
    }
}

@media (max-width: 480px) {
    
    .wpcs-widget {
        bottom: 15px;
    }
    
    .wpcs-widget.wpcs-position-right {
        right: 15px;
    }
    
    .wpcs-widget.wpcs-position-left {
        left: 15px;
    }
    
    .wpcs-toggle {
        width: 60px;
        height: 60px;
    }
    
    .wpcs-toggle-icon svg {
        width: 28px;
        height: 28px;
    }
    
    .wpcs-notification-badge {
        width: 14px;
        height: 14px;
    }
    
    .wpcs-social-proof,
    .wpcs-prompt-bubble {
        width: calc(100vw - 90px);
        max-width: none;
        bottom: 80px;
    }
    
    .wpcs-options-grid {
        gap: 6px;
    }
    
    .wpcs-option {
        padding: 12px 6px;
    }
    
    .wpcs-option-icon {
        width: 38px;
        height: 38px;
    }
    
    .wpcs-bar {
        padding: 8px 12px;
    }
    
    .wpcs-bar-inner {
        gap: 8px;
    }
    
    .wpcs-bar-btn {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .wpcs-bar-btn span {
        display: none;
    }
    
    .wpcs-bar-main {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .wpcs-bar:not(.wpcs-bar-hidden) ~ .wpcs-widget {
        bottom: 65px;
    }
    
    .wpcs-bar.wpcs-bar-hidden ~ .wpcs-widget {
        bottom: 15px;
    }
}

/* ========================================
   LOADING STATE
   ======================================== */

.wpcs-loading {
    position: relative;
    pointer-events: none;
}

.wpcs-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wpcs-spin 0.8s linear infinite;
}

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

/* ========================================
   AI CHAT INTERFACE
   ======================================== */

.wpcs-ai-chat {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0; /* Allow flex to shrink below content size */
    overflow: hidden;
}

/* When AI chat is active, panel body should not scroll - only chat messages scroll */
.wpcs-panel-body:has(.wpcs-ai-chat:not(.wpcs-hidden)) {
    overflow: hidden !important;
    min-height: 0; /* Allow flex to shrink below content size */
}

.wpcs-chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(0, 0, 0, 0.02);
}

/* Compact chat-first header */
.wpcs-chat-first-header {
    padding: 8px 15px;
    background: linear-gradient(135deg, rgba(var(--wpcs-primary-rgb, 0, 123, 255), 0.08), rgba(var(--wpcs-primary-rgb, 0, 123, 255), 0.03));
}

.wpcs-chat-header span,
.wpcs-chat-header .wpcs-chat-title {
    font-weight: 600;
    color: #333;
}

.wpcs-chat-first-header .wpcs-chat-title {
    font-size: 13px;
    font-weight: 500;
    color: #555;
}

/* Hide chat-first header when nav header is shown (user came from menu) */
.wpcs-ai-chat:has(.wpcs-chat-nav-header:not(.wpcs-hidden)) .wpcs-chat-first-header {
    display: none;
}

.wpcs-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f9fafb;
    min-height: 0; /* Required for flex children to scroll */
    scroll-behavior: smooth;
}

.wpcs-chat-message {
    display: flex;
    gap: 8px;
    max-width: 85%;
}

/* Messages with contact cards should be full width */
.wpcs-chat-message:has(.wpcs-inline-card) {
    max-width: 100%;
    width: 100%;
}

.wpcs-chat-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.wpcs-chat-ai {
    align-self: flex-start;
    max-width: 95%; /* AI messages can be wider for better readability */
}

/* AI messages with contact cards should be full width */
.wpcs-chat-ai:has(.wpcs-inline-card) {
    max-width: 100%;
    width: 100%;
}

.wpcs-chat-avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.wpcs-chat-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.wpcs-chat-avatar .wpcs-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: block;
    background: var(--wpcs-primary);
    border-radius: 50%;
}

.wpcs-chat-bubble {
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    flex: 1; /* Allow bubble to expand to fill available space */
    min-width: 0; /* Prevent flex item from overflowing */
}

.wpcs-chat-user .wpcs-chat-bubble {
    background: var(--wpcs-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.wpcs-chat-ai .wpcs-chat-bubble {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* AI Links in chat */
.wpcs-ai-link {
    color: var(--wpcs-primary);
    text-decoration: underline;
    word-break: break-word;
    overflow-wrap: break-word;
}

.wpcs-ai-link:hover {
    opacity: 0.8;
}

.wpcs-chat-bubble {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Typing indicator */
.wpcs-typing-dots {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.wpcs-typing-dots span {
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    animation: wpcs-typing-bounce 1.4s ease-in-out infinite;
}

.wpcs-typing-dots span:nth-child(1) { animation-delay: 0s; }
.wpcs-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.wpcs-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes wpcs-typing-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Chat input area */
.wpcs-chat-input-area {
    padding: 12px 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: white;
    position: relative;
}

/* Privacy note - icon with tooltip */


.wpcs-chat-form {
    display: flex;
    gap: 8px;
}

.wpcs-chat-tools {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.wpcs-chat-tool-btn {
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.wpcs-chat-tool-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.wpcs-chat-tool-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wpcs-chat-form input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.wpcs-chat-form input:focus {
    border-color: var(--wpcs-primary);
}

.wpcs-chat-send {
    min-width: 40px;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--wpcs-primary);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: filter 0.15s, transform 0.1s;
    flex-shrink: 0;
    padding: 0;
}

.wpcs-chat-send svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.wpcs-chat-send:hover {
    filter: brightness(0.9);
}

.wpcs-chat-send:active {
    transform: scale(0.95);
}

/* SMS Continue link - hidden on desktop, shown on mobile */
.wpcs-sms-continue {
    display: none; /* Hidden by default (desktop) */
}

@media screen and (max-width: 768px) {
    .wpcs-sms-continue {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        margin-top: 10px;
        padding: 8px 12px;
        font-size: 13px;
        color: var(--wpcs-primary);
        text-decoration: none;
        background: color-mix(in srgb, var(--wpcs-primary) 8%, white);
        border-radius: 20px;
        transition: background 0.2s;
    }
    
    .wpcs-sms-continue:hover {
        background: color-mix(in srgb, var(--wpcs-primary) 15%, white);
    }
    
    .wpcs-sms-continue svg {
        flex-shrink: 0;
    }
}

/* Talk to Team button - desktop only (mobile has SMS continue) */
.wpcs-talk-to-team {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 8px;
    padding: 6px 12px;
    font-size: 12px;
    color: #666;
    background: transparent;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

@media (min-width: 769px) {
    .wpcs-talk-to-team {
        display: flex;
    }
}

.wpcs-talk-to-team:hover {
    color: var(--wpcs-primary);
    background: color-mix(in srgb, var(--wpcs-primary) 8%, white);
}

.wpcs-talk-to-team svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.wpcs-talk-to-team:hover svg {
    opacity: 1;
}

/* Conversation Starters */
.wpcs-chat-starters {
    padding: 12px 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: #fafafa;
}

.wpcs-starter-btn {
    padding: 8px 14px;
    background: white;
    border: 1px solid var(--wpcs-primary);
    border-radius: 18px;
    font-size: 13px;
    color: var(--wpcs-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.wpcs-starter-btn:hover {
    background: var(--wpcs-primary);
    color: white;
}

.wpcs-chat-starters.wpcs-hidden {
    display: none;
}

/* Escalation options */
/* Legacy escalation container - hidden, no longer used */
.wpcs-chat-escalation {
    display: none !important;
}

/* Inline escalation (inside chat messages) */
.wpcs-inline-escalation {
    padding: 4px 0 !important;
}

.wpcs-inline-escalation .wpcs-escalation-message {
    font-size: 14px !important;
    color: #333 !important;
    margin-bottom: 10px !important;
    text-align: left !important;
}

.wpcs-inline-escalation .wpcs-escalation-buttons {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    justify-content: flex-start !important;
}

.wpcs-escalation-btn {
    padding: 8px 16px !important;
    border: 1px solid var(--wpcs-primary) !important;
    background: white !important;
    color: var(--wpcs-primary) !important;
    border-radius: 20px !important;
    font-size: 13px !important;
    cursor: pointer !important;
    transition: all 0.2s !important;
}

.wpcs-escalation-btn:hover {
    background: var(--wpcs-primary) !important;
    color: white !important;
}

/* Follow-up suggestion buttons */
.wpcs-followups {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 0 8px 44px; /* Align with chat bubble (after avatar space) */
    margin-top: -4px;
}

.wpcs-followup-btn {
    padding: 6px 12px;
    background: white;
    border: 1px solid var(--wpcs-primary);
    border-radius: 16px;
    font-size: 12px;
    color: var(--wpcs-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.wpcs-followup-btn:hover {
    background: var(--wpcs-primary);
    color: white;
}

/* AI Chat button styling - match other contact options */
.wpcs-option-ai-chat {
    /* Uses same styling as other .wpcs-option buttons */
}

/* Inline Appointment Form in Chat */
.wpcs-inline-appointment-form {
    width: 100%;
}

.wpcs-chat-form-bubble {
    background: #f8f9fa !important;
    padding: 16px !important;
    max-width: none !important;
}

.wpcs-inline-form-field {
    margin-bottom: 10px;
}

.wpcs-inline-form-field input,
.wpcs-inline-form-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.wpcs-inline-form-field input:focus,
.wpcs-inline-form-field select:focus {
    outline: none;
    border-color: var(--wpcs-primary);
    box-shadow: 0 0 0 3px rgba(var(--wpcs-primary-rgb, 0, 123, 255), 0.15);
}

.wpcs-inline-form-field input::placeholder {
    color: #999;
}

.wpcs-inline-form-submit {
    width: 100%;
    padding: 12px 20px;
    background: var(--wpcs-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: filter 0.15s, transform 0.15s;
}

.wpcs-inline-form-submit:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
}

.wpcs-inline-form-submit:active {
    transform: scale(0.98);
}

.wpcs-inline-form-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.wpcs-inline-form-submit svg {
    flex-shrink: 0;
}

.wpcs-inline-form-success {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #d4edda;
    border-radius: 8px;
    color: #155724;
    font-size: 14px;
}

.wpcs-inline-form-success svg {
    flex-shrink: 0;
    color: #28a745;
}

/* Loading spinner for form submit */
.wpcs-loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: wpcs-spin 0.8s linear infinite;
}

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

/* ========================================
   SUBSCREENS (Phone, SMS, Email, Callback)
   ======================================== */

.wpcs-subscreen {
    padding: 0;
}

.wpcs-subscreen-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px dashed #e5e7eb;
    background: #f8f9fa;
}

.wpcs-subscreen-header .wpcs-back {
    padding: 6px 10px;
    font-size: 16px;
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.2s;
}

.wpcs-subscreen-header .wpcs-back:hover {
    color: var(--wpcs-primary);
}

.wpcs-subscreen-title {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #6b7280;
    font-size: 14px;
}

.wpcs-subscreen-title svg {
    opacity: 0.7;
}

.wpcs-subscreen-content {
    padding: 16px 20px;
    text-align: center;
}

.wpcs-subscreen-prompt {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 10px 0;
}

.wpcs-subscreen-instruction {
    color: #6b7280;
    font-size: 14px;
    margin: 8px 0;
    line-height: 1.5;
}

.wpcs-subscreen-instruction a {
    color: var(--wpcs-primary);
    text-decoration: none;
}

.wpcs-subscreen-instruction a:hover {
    text-decoration: underline;
}

/* QR Code Container */
.wpcs-qr-container {
    display: flex;
    justify-content: center;
    margin: 0;
}

.wpcs-qr-code {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    display: block;
}

.wpcs-qr-fallback {
    padding: 20px;
    background: #f3f4f6;
    border-radius: 8px;
    color: #6b7280;
    font-size: 12px;
}

/* Engage QR Card Layout - side by side */
.wpcs-qr-card-layout {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
}

.wpcs-qr-card-text {
    flex: 1 1 auto;
    font-size: 14px;
    color: #4b5563;
    line-height: 1.4;
}

.wpcs-qr-card-frame {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 92px;
    height: 92px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 4px;
    box-sizing: border-box;
}

.wpcs-qr-card-frame .wpcs-qr-container {
    margin: 0;
}

.wpcs-qr-card-frame .wpcs-qr-code {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    box-shadow: none;
}

/* ===== Engage Contact Card (Integrated Design) ===== */
.wpcs-engage-contact-card {
    padding: 16px !important;
    background: #fff !important;
    text-align: left;
}

/* Full-width card (no avatar) */
.wpcs-engage-fullwidth {
    margin: 0 !important;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.wpcs-engage-card-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
}

.wpcs-engage-card-content {
    flex: 1 1 auto;
    min-width: 0;
}

.wpcs-engage-card-icon {
    width: 40px;
    height: 40px;
    background: color-mix(in srgb, var(--wpcs-primary) 12%, white);
    color: var(--wpcs-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.wpcs-engage-card-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.wpcs-engage-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 2px 0;
}

.wpcs-engage-card-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 10px 0;
}

.wpcs-engage-card-phone {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    text-decoration: none !important;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.wpcs-engage-card-phone:hover {
    color: var(--wpcs-primary);
}

.wpcs-engage-card-action {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 18px;
    background: var(--wpcs-primary) !important;
    color: #fff !important;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none !important;
    transition: filter 0.15s, transform 0.15s;
    white-space: nowrap;
    /* Reset button defaults for theme compatibility */
    border: none !important;
    cursor: pointer;
    font-family: inherit;
    line-height: 1.4;
    box-shadow: none !important;
}

/* Extra specificity for button elements to override theme styles */
button.wpcs-engage-card-action,
.wpcs-engage-form button.wpcs-engage-card-action {
    background: var(--wpcs-primary) !important;
    border: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
    outline: none;
}

button.wpcs-engage-card-action:hover,
button.wpcs-engage-card-action:focus,
.wpcs-engage-form button.wpcs-engage-card-action:hover,
.wpcs-engage-form button.wpcs-engage-card-action:focus {
    background: var(--wpcs-primary) !important;
    border: none !important;
    border-color: transparent !important;
    box-shadow: none !important;
    filter: brightness(0.9);
}

.wpcs-engage-card-action svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.wpcs-engage-card-action:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
}

.wpcs-engage-card-qr {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.wpcs-engage-qr-frame {
    width: 92px;
    height: 92px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 4px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wpcs-engage-qr-frame .wpcs-qr-container {
    margin: 0;
}

.wpcs-engage-qr-frame .wpcs-qr-code {
    width: 80px !important;
    height: 80px !important;
    border-radius: 6px;
    box-shadow: none;
}

.wpcs-engage-qr-label {
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
}

/* Form Card Header (horizontal icon + text) */
.wpcs-engage-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.wpcs-engage-card-header .wpcs-engage-card-icon {
    margin-bottom: 0;
    flex-shrink: 0;
}

.wpcs-engage-card-header-text {
    flex: 1 1 auto;
}

.wpcs-engage-card-header-text .wpcs-engage-card-title {
    margin-bottom: 2px;
}

.wpcs-engage-card-header-text .wpcs-engage-card-subtitle {
    margin-bottom: 0;
}

/* Engage Form Styles */
.wpcs-engage-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wpcs-engage-form input,
.wpcs-engage-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.wpcs-engage-form input:focus,
.wpcs-engage-form textarea:focus {
    outline: none;
    border-color: var(--wpcs-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--wpcs-primary) 15%, transparent);
}

.wpcs-engage-form textarea {
    resize: none;
    min-height: 50px;
}

.wpcs-engage-form .wpcs-engage-card-action {
    margin-top: 4px;
    border: none;
    cursor: pointer;
    width: 100%;
    justify-content: center;
}

/* Form Card - compact for short screens */
.wpcs-engage-form-card {
    padding: 14px !important;
}

.wpcs-engage-form-card .wpcs-engage-card-icon {
    width: 36px;
    height: 36px;
}

.wpcs-engage-form-card .wpcs-engage-card-icon svg {
    width: 18px;
    height: 18px;
}

/* Phone Number Display */
.wpcs-phone-number-display {
    display: inline-block;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 8px 0;
    text-decoration: none;
}

.wpcs-phone-number-display:hover {
    color: var(--wpcs-primary);
}

/* Action Button (Call now, Send message, etc.) */
.wpcs-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--wpcs-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: filter 0.15s, transform 0.15s;
    margin-top: 16px;
    width: 100%;
}

.wpcs-action-button:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
}

.wpcs-action-button:active {
    transform: scale(0.98);
}

.wpcs-action-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.wpcs-action-button svg {
    flex-shrink: 0;
}

/* SMS Composer (Mobile only) */
.wpcs-sms-composer textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    resize: none;
    font-family: inherit;
    margin-bottom: 8px;
}

.wpcs-sms-composer textarea:focus {
    outline: none;
    border-color: var(--wpcs-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Email Form */
.wpcs-email-form .wpcs-form-group {
    margin-bottom: 12px;
    text-align: left;
}

.wpcs-email-form input,
.wpcs-email-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}

.wpcs-email-form textarea {
    resize: none;
}

.wpcs-email-form input:focus,
.wpcs-email-form textarea:focus {
    outline: none;
    border-color: var(--wpcs-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Simplified Callback Form */
.wpcs-callback-form-simple .wpcs-form-group {
    margin-bottom: 12px;
    text-align: left;
}

.wpcs-callback-form-simple input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.wpcs-callback-form-simple input:focus {
    outline: none;
    border-color: var(--wpcs-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Form Success Message */
.wpcs-form-success {
    text-align: center;
    padding: 20px;
}

.wpcs-form-success .wpcs-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: #d4edda;
    border-radius: 50%;
    color: #28a745;
    font-size: 24px;
    margin-bottom: 12px;
}

.wpcs-form-success p {
    color: #155724;
    font-size: 15px;
    margin: 0;
}

/* ========================================
   ENHANCED HOURS DROPDOWN
   ======================================== */

.wpcs-hours-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #e5e7eb;
    color: #6b7280;
    font-size: 13px;
}

.wpcs-hours-header strong {
    color: #1f2937;
}

.wpcs-hours-today {
    font-weight: 700 !important;
}

.wpcs-hours-today .wpcs-hours-day,
.wpcs-hours-today .wpcs-hours-time {
    font-weight: 700;
    color: #1f2937;
}

.wpcs-hours-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    margin: 12px 0 4px 0;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.wpcs-hours-status-badge.wpcs-status-open {
    background: transparent;
    border: 1px solid #22c55e;
    color: #16a34a;
}

.wpcs-hours-status-badge.wpcs-status-closed {
    background: transparent;
    border: 1px solid #ef4444;
    color: #dc2626;
}

/* Adjust hours dropdown for new header */
.wpcs-hours-dropdown .wpcs-hours-row {
    padding: 8px 12px;
}

/* ===== Chat Bubble Style for Contact Screens ===== */
.wpcs-chat-style {
    padding: 16px;
}

.wpcs-chat-bubble-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
}

.wpcs-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.wpcs-chat-avatar-placeholder {
    background: linear-gradient(135deg, var(--wpcs-accent, #4f46e5) 0%, var(--wpcs-accent-hover, #4338ca) 100%);
}

.wpcs-chat-avatar-system {
    background: #e5e7eb;
}

/* Link styling inside chat bubbles - consolidated here */
.wpcs-chat-bubble a:not(.wpcs-card-action) {
    color: var(--wpcs-primary);
    text-decoration: underline;
    font-weight: 500;
}

.wpcs-qr-bubble {
    text-align: left;
}

.wpcs-qr-bubble .wpcs-qr-container {
    margin: 0;
    display: flex;
    justify-content: center;
}

.wpcs-qr-bubble .wpcs-qr-container img {
    border-radius: 6px;
}

/* Hide QR code section on mobile */
.wpcs-desktop-only {
    display: flex;
}

@media (max-width: 768px) {
    .wpcs-desktop-only {
        display: none !important;
    }
    
    /* Compact form layout for short mobile screens */
    .wpcs-subscreen-content {
        padding: 16px 16px;
    }
    
    .wpcs-engage-form {
        gap: 8px;
    }
    
    .wpcs-engage-form input,
    .wpcs-engage-form textarea {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    .wpcs-engage-form textarea {
        min-height: 50px;
    }
    
    .wpcs-engage-form-card {
        padding: 12px !important;
    }
    
    .wpcs-engage-form-card .wpcs-engage-card-icon {
        width: 32px;
        height: 32px;
        margin-bottom: 6px;
    }
    
    .wpcs-engage-form-card .wpcs-engage-card-title {
        font-size: 14px;
        margin-bottom: 1px;
    }
    
    .wpcs-engage-form-card .wpcs-engage-card-subtitle {
        font-size: 12px;
        margin-bottom: 8px;
    }
    
    .wpcs-engage-form .wpcs-engage-card-action {
        padding: 10px 16px;
        margin-top: 2px;
    }
}

/* ===== Inline Contact Cards (Chat-First Experience) ===== */
/* Ensure bubbles with cards expand fully */
.wpcs-chat-bubble:has(.wpcs-inline-card) {
    width: 100% !important;
    max-width: 100% !important;
}

/* Card container - stacked layout */
.wpcs-inline-card {
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 16px !important;
    padding: 16px !important;
    margin-top: 12px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 200px !important;
    display: block !important;
    overflow: visible !important;
}

/* Prevent double scrollbars */
.wpcs-inline-card * {
    overflow: visible !important;
}

.wpcs-inline-card textarea {
    overflow: auto !important;
}

/* Header row: icon + title */
.wpcs-inline-card .wpcs-card-header {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    margin-bottom: 12px !important;
    width: 100% !important;
}

/* Icon styling - uses theme primary color */
.wpcs-inline-card .wpcs-card-icon {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    background: color-mix(in srgb, var(--wpcs-primary) 12%, white) !important;
    color: var(--wpcs-primary) !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
}

.wpcs-inline-card .wpcs-card-icon svg {
    width: 24px !important;
    height: 24px !important;
    fill: currentColor !important;
}

/* Title styling */
.wpcs-inline-card .wpcs-card-title {
    font-weight: 600 !important;
    font-size: 16px !important;
    color: #1f2937 !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    word-wrap: break-word !important;
}

/* Body content - stacked */
.wpcs-inline-card .wpcs-card-body {
    display: block !important;
    width: 100% !important;
    margin-bottom: 12px !important;
}

/* Phone number - compact to fit with QR */
.wpcs-inline-card .wpcs-card-phone {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #1f2937 !important;
    display: block !important;
    white-space: nowrap !important;
    text-decoration: none !important;
}

/* Email and address - can wrap */
.wpcs-inline-card .wpcs-card-email,
.wpcs-inline-card .wpcs-card-address {
    font-size: 14px !important;
    color: #4b5563 !important;
    display: block !important;
    width: 100% !important;
    word-wrap: break-word !important;
}

/* Status notes */
.wpcs-inline-card .wpcs-card-status-note {
    font-size: 13px !important;
    color: #ef4444 !important;
    margin-top: 8px !important;
    padding: 8px 12px !important;
    background: #fef2f2 !important;
    border-radius: 8px !important;
    display: block !important;
}

.wpcs-inline-card .wpcs-card-status-open {
    font-size: 13px !important;
    color: #16a34a !important;
    margin-top: 6px !important;
    font-weight: 500 !important;
    display: block !important;
}

/* QR Code section - refined compact design */
.wpcs-card-qr-section {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
}

.wpcs-card-qr-frame {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 88px !important;
    height: 88px !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 4px !important;
    box-sizing: border-box !important;
}

.wpcs-card-qr-frame img {
    width: 76px !important;
    height: 76px !important;
    border-radius: 6px !important;
    display: block !important;
}

.wpcs-card-qr-label {
    font-size: 11px !important;
    color: #94a3b8 !important;
    margin: 0 !important;
    text-align: center !important;
}

.wpcs-inline-card .wpcs-card-qr {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.wpcs-inline-card .wpcs-card-qr img {
    width: 76px !important;
    height: 76px !important;
    border-radius: 6px !important;
    display: block !important;
}

.wpcs-inline-card .wpcs-card-qr .wpcs-qr-fallback {
    font-size: 11px !important;
    color: #94a3b8 !important;
    margin: 0 !important;
}

/* Side-by-side layout for QR cards on desktop */
.wpcs-card-content-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 16px !important;
    margin-bottom: 12px !important;
}

.wpcs-card-content-row .wpcs-card-content {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

.wpcs-card-content-row .wpcs-card-qr-section {
    flex-shrink: 0 !important;
}

/* Action button - uses theme primary color */
.wpcs-inline-card .wpcs-card-action {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 11px 20px !important;
    background: var(--wpcs-primary) !important;
    color: white !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    transition: background 0.15s, transform 0.15s, filter 0.15s !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.wpcs-inline-card .wpcs-card-action svg {
    width: 16px !important;
    height: 16px !important;
    fill: currentColor !important;
}

.wpcs-inline-card .wpcs-card-action:hover {
    filter: brightness(0.9) !important;
    transform: translateY(-1px) !important;
}

/* Call, SMS, Email, Directions cards - horizontal layout */
.wpcs-call-card,
.wpcs-sms-card,
.wpcs-email-card,
.wpcs-directions-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 16px !important;
}

/* Callback card - form layout */
.wpcs-callback-card .wpcs-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.wpcs-inline-callback-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wpcs-inline-callback-form input {
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.wpcs-inline-callback-form input:focus {
    outline: none;
    border-color: var(--wpcs-primary, #4f46e5);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.wpcs-inline-callback-form button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    background: var(--wpcs-primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: filter 0.15s, transform 0.15s;
    width: 100%;
}

.wpcs-inline-callback-form button:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
}

.wpcs-inline-callback-form button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.wpcs-inline-callback-success {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #dcfce7;
    color: #15803d;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
}

/* Contact Options Grid Card */
.wpcs-contact-options-card .wpcs-card-title {
    margin-bottom: 12px;
    text-align: center;
    font-size: 13px;
}

/* Compact grid version (no title, smaller buttons) */
.wpcs-compact-grid .wpcs-card-title {
    display: none;
}

.wpcs-contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.wpcs-contact-option,
a.wpcs-contact-option,
a.wpcs-contact-option:link,
a.wpcs-contact-option:visited {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    text-decoration: none !important;
    color: #1f2937 !important;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.wpcs-contact-option:hover,
a.wpcs-contact-option:hover {
    background: var(--wpcs-primary, #4f46e5);
    border-color: var(--wpcs-primary, #4f46e5);
    color: white !important;
}

.wpcs-contact-option svg {
    width: 18px;
    height: 18px;
}

.wpcs-contact-options-card .wpcs-card-status-note {
    margin-top: 16px;
}

/* Chat bubble containing a card */
.wpcs-chat-card-bubble {
    background: transparent !important;
    padding: 0 !important;
    border: none !important;
}

.wpcs-chat-card-bubble .wpcs-inline-card {
    margin-top: 0;
}

.wpcs-footer-link svg {
    width: 14px;
    height: 14px;
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .wpcs-toggle,
    .wpcs-panel,
    .wpcs-message,
    .wpcs-engage-card-action,
    .wpcs-back,
    .wpcs-close,
    .wpcs-contact-option,
    .wpcs-prompt-bubble,
    .wpcs-social-proof-bubble {
        animation: none !important;
        transition: none !important;
    }
}

/* Button active/pressed state */
.wpcs-engage-card-action:active,
.wpcs-contact-option:active,
.wpcs-card-action:active {
    transform: scale(0.97);
}

/* Validation shake animation */
@keyframes wpcs-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.wpcs-shake {
    animation: wpcs-shake 0.5s ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
    .wpcs-shake {
        animation: none;
    }
}

/* Maps app chooser modal (iOS) */
.wpcs-maps-chooser-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2147483647;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 20px;
    animation: wpcs-fade-in 0.2s ease;
}

.wpcs-maps-chooser {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 320px;
    padding: 20px;
    animation: wpcs-slide-up 0.3s ease;
}

@keyframes wpcs-slide-up {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes wpcs-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.wpcs-maps-chooser-title {
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 16px;
    color: #333;
}

.wpcs-maps-chooser-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.wpcs-maps-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #f9fafb;
    font-size: 16px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.wpcs-maps-option:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.wpcs-maps-option:active {
    transform: scale(0.98);
}

.wpcs-maps-option svg {
    flex-shrink: 0;
}

/* Apple Maps icon color */
.wpcs-maps-option[data-app="apple"] svg {
    color: #333;
}

/* Google Maps icon color */
.wpcs-maps-option[data-app="google"] svg {
    color: #4285f4;
}

.wpcs-maps-chooser-cancel {
    width: 100%;
    padding: 12px;
    border: none;
    background: transparent;
    font-size: 15px;
    color: #666;
    cursor: pointer;
}

.wpcs-maps-chooser-cancel:hover {
    color: #333;
}

@media (prefers-reduced-motion: reduce) {
    .wpcs-maps-chooser-overlay,
    .wpcs-maps-chooser {
        animation: none;
    }
}
