/**
 * Surf Social Styles
 */

/* Variables */
:root {
    --surf-primary: #000000;
    --surf-secondary: #f5f5f5;
    --surf-accent: #333333;
    --surf-success: #000000;
    --surf-warning: #666666;
    --surf-danger: #000000;
    --surf-bg: #ffffff;
    --surf-text: #000000;
    --surf-text-muted: #666666;
    --surf-border-radius: 16px;
    --surf-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    --surf-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --surf-backdrop-blur: blur(20px);
}

/* Main Widget Container */
#surf-social-widget {
    position: fixed;
    bottom: 0;
    right: 0;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Bottom Widget Bar */
.surf-widget-bar {
    position: fixed;
    bottom: 25px;
    right: 20px;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    z-index: 1000000;
}

/* Notes Toggle Button */
#surf-social-widget .surf-notes-toggle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: white !important;
    color: black !important;
    border: none !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--surf-shadow);
    transition: var(--surf-transition);
    backdrop-filter: var(--surf-backdrop-blur);
    flex-shrink: 0;
    position: relative;
    overflow: visible;
}

.surf-notes-toggle:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

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

.surf-notes-toggle.active {
    background: #007AFF !important;
    color: white !important;
    box-shadow: 0 8px 32px rgba(0, 122, 255, 0.3);
}

.surf-notes-toggle svg {
    color: #007AFF;
    fill: #007AFF;
}

/* Draw Toggle Button */
#surf-social-widget .surf-draw-toggle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: white !important;
    color: black !important;
    border: none !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--surf-shadow);
    transition: var(--surf-transition);
    backdrop-filter: var(--surf-backdrop-blur);
    flex-shrink: 0;
    position: relative;
    overflow: visible;
}

.surf-draw-toggle:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

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

.surf-draw-toggle.active {
    background: #FF6B6B !important;
    color: white !important;
    box-shadow: 0 8px 32px rgba(255, 107, 107, 0.3);
}

.surf-draw-toggle svg {
    color: #FF6B6B;
    fill: #FF6B6B;
}

/* Voice Chat Toggle Button */
#surf-social-widget .surf-voice-toggle {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: white !important;
    color: black !important;
    border: none !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--surf-shadow);
    transition: var(--surf-transition);
    backdrop-filter: var(--surf-backdrop-blur);
    flex-shrink: 0;
    position: relative;
    overflow: visible;
}

.surf-voice-toggle:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

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

.surf-voice-toggle.active {
    background: #10B981 !important;
    color: white !important;
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.3);
    animation: voicePulse 2s infinite;
}

.surf-voice-toggle svg {
    color: #10B981;
    fill: #10B981;
}

@keyframes voicePulse {
    0% {
        box-shadow: 0 8px 32px rgba(16, 185, 129, 0.3);
    }
    50% {
        box-shadow: 0 8px 32px rgba(16, 185, 129, 0.6);
    }
    100% {
        box-shadow: 0 8px 32px rgba(16, 185, 129, 0.3);
    }
}

/* Chat Toggle Button */
#surf-social-widget .surf-chat-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: white !important;
    color: black !important;
    border: none !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--surf-shadow);
    transition: var(--surf-transition);
    backdrop-filter: var(--surf-backdrop-blur);
    flex-shrink: 0;
    position: relative;
    overflow: visible;
}

/* Improved ripple effect */
#surf-social-widget .surf-chat-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    transform: translate(-50%, -50%);
    animation: rippleEffect 4s infinite;
    pointer-events: none;
    z-index: -1;
}

.surf-chat-toggle:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

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

.surf-unread-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--surf-primary);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    border: 2px solid white;
}

/* Chat Drawer */
.surf-chat-drawer {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 100%;
    max-width: 420px;
    height: 75vh;
    max-height: 650px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--surf-backdrop-blur);
    border-radius: var(--surf-border-radius);
    box-shadow: var(--surf-shadow);
    border: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transform: translateY(100%) scale(0.95);
    transition: var(--surf-transition);
    z-index: 999998;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
}

.surf-chat-drawer.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}


/* Chat Tabs */
.surf-chat-tabs {
    display: flex;
    padding: 0 16px;
    gap: 0;
    background: var(--surf-primary);
    backdrop-filter: blur(10px);
    border-radius: var(--surf-border-radius) var(--surf-border-radius) 0 0;
    overflow: visible;
    position: relative;
    z-index: 1000000;
}

/* Chat Title */
.surf-chat-title {
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-weight: 600;
    font-size: 16px;
    color: var(--surf-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Hide title when empty */
.surf-chat-title:empty {
    display: none;
}

.surf-back-button {
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    padding: 4px !important;
    border-radius: 4px !important;
    color: var(--surf-text-muted) !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
    text-decoration: none !important;
    box-shadow: none !important;
    outline: none !important;
    margin: 0 !important;
    min-width: auto !important;
    min-height: auto !important;
    width: auto !important;
    height: auto !important;
}

.surf-back-button:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    color: var(--surf-primary) !important;
    text-decoration: none !important;
    box-shadow: none !important;
    transform: none !important;
}

.surf-back-button:focus {
    outline: none !important;
    box-shadow: none !important;
    background: rgba(0, 0, 0, 0.05) !important;
}

.surf-back-button:active {
    background: rgba(0, 0, 0, 0.1) !important;
    transform: none !important;
}

.surf-back-button svg {
    width: 16px !important;
    height: 16px !important;
    fill: currentColor !important;
    stroke: currentColor !important;
}

/* Additional specificity to override WordPress theme styles */
#surf-social-widget .surf-chat-title .surf-back-button {
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    padding: 4px !important;
    border-radius: 4px !important;
    color: var(--surf-text-muted) !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
    text-decoration: none !important;
    box-shadow: none !important;
    outline: none !important;
    margin: 0 !important;
    min-width: auto !important;
    min-height: auto !important;
    width: auto !important;
    height: auto !important;
}

#surf-social-widget .surf-chat-title .surf-back-button:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    color: var(--surf-primary) !important;
    text-decoration: none !important;
    box-shadow: none !important;
    transform: none !important;
}

#surf-social-widget .surf-chat-title .surf-back-button:focus {
    outline: none !important;
    box-shadow: none !important;
    background: rgba(0, 0, 0, 0.05) !important;
}

#surf-social-widget .surf-chat-title .surf-back-button:active {
    background: rgba(0, 0, 0, 0.1) !important;
    transform: none !important;
}

#surf-social-widget .surf-chat-tab {
    flex: 1;
    padding: 11px 12px;
    background: transparent !important;
    border: none !important;
    color: white !important;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    position: relative !important;
    overflow: visible !important;
    border-radius: 12px 12px 0 0;
    margin: 0 2px;
    z-index: 1;
    box-sizing: border-box !important;
    text-align: center !important;
    vertical-align: middle !important;
}

#surf-social-widget .surf-chat-tab.active {
    background: white !important;
    color: var(--surf-primary) !important;
    font-weight: 600;
    position: relative;
    z-index: 1000001;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 5px;
    overflow: visible;
}

/* Tab Badge Styles - High specificity to override WordPress themes */
#surf-social-widget .surf-tab-badge,
#surf-social-widget .surf-chat-tab .surf-tab-badge {
    position: absolute !important;
    top: 3px !important;
    right: 6px !important;
    background: #000000 !important;
    color: white !important;
    border-radius: 50% !important;
    min-width: 16px !important;
    height: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 10px !important;
    font-weight: bold !important;
    border: 1px solid #ffffff !important;
    z-index: 1000002 !important;
    padding: 0 3px !important;
    line-height: 1 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    margin: 0 !important;
    font-family: inherit !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

#surf-social-widget .surf-tab-badge.hidden,
#surf-social-widget .surf-chat-tab .surf-tab-badge.hidden {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Additional protection against theme interference */
#surf-social-widget .surf-tab-badge *,
#surf-social-widget .surf-chat-tab .surf-tab-badge * {
    all: unset !important;
    display: inherit !important;
    color: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
}

/* Ensure badges are not affected by theme transitions */
#surf-social-widget .surf-tab-badge,
#surf-social-widget .surf-chat-tab .surf-tab-badge {
    transition: none !important;
    animation: none !important;
}

/* Improved ripple effect animation */
@keyframes rippleEffect {
    0% {
        width: 0;
        height: 0;
        opacity: 0.3;
    }
    50% {
        width: 60px;
        height: 60px;
        opacity: 0.1;
    }
    100% {
        width: 60px;
        height: 60px;
        opacity: 0;
    }
}


/* Chat Messages */
.surf-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: white;
}

.surf-chat-messages::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

.surf-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.surf-chat-messages::-webkit-scrollbar-thumb {
    background: transparent;
}

/* Hide scrollbar for Firefox */
.surf-chat-messages {
    scrollbar-width: none;
}

/* Hide scrollbar for IE and Edge */
.surf-chat-messages {
    -ms-overflow-style: none;
}

.surf-message {
    display: flex;
    gap: 12px;
    animation: slideInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 16px;
    align-items: flex-start;
    min-height: 40px;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.surf-message.own {
    flex-direction: row-reverse;
}

.surf-message-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 10px;
    color: white;
    flex-shrink: 0;
}

.surf-message-content {
    max-width: 70%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    align-items: flex-start;
    min-height: 40px;
    justify-content: flex-start;
    padding-top: 2px;
}

.surf-message.own .surf-message-content {
    align-items: flex-end;
}

.surf-message-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-height: 40px;
    justify-content: flex-start;
    padding-top: 2px;
}

.surf-message-name {
    font-size: 10px;
    color: var(--surf-text-muted);
    font-weight: 500;
    height: 12px;
    line-height: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60px;
}

.surf-message-time {
    font-size: 11px;
    color: var(--surf-text-muted);
    font-weight: 400;
}

.surf-message-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 12px;
    line-height: 1.4;
    word-wrap: break-word;
    position: relative;
    max-width: 280px;
}

/* Date Divider */
.surf-date-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    gap: 12px;
}

.surf-date-line {
    flex: 1;
    height: 1px;
    background: rgba(0, 0, 0, 0.2);
}

.surf-date-text {
    font-size: 12px;
    color: var(--surf-text-muted);
    font-weight: 500;
    white-space: nowrap;
    padding: 0 8px;
}

.surf-message:not(.own) .surf-message-bubble {
    background: #f0f0f0;
    color: var(--surf-text);
    border: 1px solid #e0e0e0;
}

.surf-message.own .surf-message-bubble {
    background: #f0f0f0;
    color: var(--surf-text);
    border: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}


/* Chat Input */
.surf-chat-input-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    position: relative;
    background: white !important;
}

/* Guest Registration Form */
.surf-guest-registration {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.surf-input-row {
    display: flex;
    gap: 8px;
}

.surf-name-input, .surf-email-input {
    flex: 1;
    padding: 10px 14px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: var(--surf-text);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.surf-name-input::placeholder, .surf-email-input::placeholder {
    color: var(--surf-text-muted);
}

.surf-name-input:focus, .surf-email-input:focus {
    border-color: var(--surf-accent);
    background: white;
}

/* Join Button with high specificity to override WordPress theme styles */
#surf-social-widget .surf-join-button,
.surf-guest-registration .surf-join-button,
#surf-join-button {
    background: var(--surf-primary) !important;
    color: white !important;
    border: none !important;
    padding: 12px 20px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transition: all 0.2s ease !important;
    font-family: inherit !important;
    margin-top: 4px !important;
    text-decoration: none !important;
    outline: none !important;
    box-shadow: none !important;
}

#surf-social-widget .surf-join-button:hover,
.surf-guest-registration .surf-join-button:hover,
#surf-join-button:hover {
    background: var(--surf-accent) !important;
    color: white !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    text-decoration: none !important;
}

#surf-social-widget .surf-join-button:active,
.surf-guest-registration .surf-join-button:active,
#surf-join-button:active {
    transform: translateY(0) !important;
    background: var(--surf-accent) !important;
    color: white !important;
}

#surf-social-widget .surf-join-button:focus,
.surf-guest-registration .surf-join-button:focus,
#surf-join-button:focus {
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1) !important;
    background: var(--surf-primary) !important;
    color: white !important;
}

#surf-social-widget .surf-join-button:disabled,
.surf-guest-registration .surf-join-button:disabled,
#surf-join-button:disabled {
    background: #ccc !important;
    color: #666 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.6 !important;
}

/* Normal Chat Input (after registration) */
.surf-normal-chat {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

#surf-social-widget .surf-chat-send {
    background: white !important;
    border: 1px solid #000000 !important;
    color: black !important;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#surf-social-widget .surf-chat-send:hover {
    background: rgba(0, 0, 0, 0.1) !important;
    color: black !important;
}

.surf-chat-input {
    flex: 1;
    padding: 10px 14px;
    background: white;
    border: 1px solid black;
    border-radius: 8px;
    color: var(--surf-text);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.surf-chat-input::placeholder {
    color: var(--surf-text-muted);
}

.surf-chat-input:focus {
    background: white;
    border-color: var(--surf-accent);
}

/* Guest Name Input Styling */
.surf-chat-input[placeholder*="Choose a Name"] {
    text-align: center;
    font-weight: 500;
    color: var(--surf-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.surf-chat-input[placeholder*="Choose a Name"]:focus {
    text-align: left;
    font-weight: normal;
}

/* Input validation states */
.surf-chat-input.validating {
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.surf-chat-input::placeholder {
    transition: color 0.2s ease;
}

.surf-chat-input[style*="border-color: #10B981"]::placeholder {
    color: #10B981 !important;
    font-weight: 500;
}

.surf-chat-input[style*="border-color: #EF4444"]::placeholder {
    color: #EF4444 !important;
    font-weight: 500;
}

/* Guest Registration Input Validation with high specificity */
#surf-social-widget .surf-name-input.valid, 
#surf-social-widget .surf-email-input.valid,
.surf-guest-registration .surf-name-input.valid,
.surf-guest-registration .surf-email-input.valid {
    border-color: #10B981 !important;
    color: #10B981 !important;
}

#surf-social-widget .surf-name-input.invalid, 
#surf-social-widget .surf-email-input.invalid,
.surf-guest-registration .surf-name-input.invalid,
.surf-guest-registration .surf-email-input.invalid {
    border-color: #EF4444 !important;
    color: #EF4444 !important;
}

#surf-social-widget .surf-name-input.valid::placeholder, 
#surf-social-widget .surf-email-input.valid::placeholder,
.surf-guest-registration .surf-name-input.valid::placeholder,
.surf-guest-registration .surf-email-input.valid::placeholder {
    color: #10B981 !important;
    font-weight: 500 !important;
}

#surf-social-widget .surf-name-input.invalid::placeholder, 
#surf-social-widget .surf-email-input.invalid::placeholder,
.surf-guest-registration .surf-name-input.invalid::placeholder,
.surf-guest-registration .surf-email-input.invalid::placeholder {
    color: #EF4444 !important;
    font-weight: 500 !important;
}

/* Form transition animations */
.surf-guest-registration, .surf-normal-chat {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.surf-guest-registration.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.surf-normal-chat.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

/* Success Animation */
.surf-name-success {
    position: absolute;
    top: 50%;
    right: 50px;
    transform: translateY(-50%);
    color: #10B981;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000001;
    pointer-events: none;
}

.surf-name-success.show {
    opacity: 1;
    transform: translateY(-50%) scale(1);
    animation: successPulse 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.surf-name-success.hide {
    opacity: 0;
    transform: translateY(-50%) scale(0.8);
}

@keyframes successPulse {
    0% {
        transform: translateY(-50%) scale(0.5);
        opacity: 0;
    }
    50% {
        transform: translateY(-50%) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translateY(-50%) scale(1);
        opacity: 1;
    }
}

/* Avatar Dock */
.surf-avatar-dock {
    min-width: 60px;
    height: 45px;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: var(--surf-backdrop-blur);
    border-radius: 22.5px;
    box-shadow: var(--surf-shadow);
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
    flex-shrink: 0;
    position: relative;
    padding: 0 12px 0 16px;
    gap: -5px;
}

/* When multiple avatars, align to start */
.surf-avatar-dock.multiple {
    justify-content: flex-start;
}

.surf-avatar-dock.hidden {
    opacity: 0;
    transform: scale(0.8);
}

.surf-avatar-chip {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    color: white;
    background-color: var(--surf-primary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 2px solid white;
    z-index: 1;
    flex-shrink: 0;
    margin-left: -8px;
}

.surf-avatar-chip:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.surf-avatar-chip.surf-avatar-more {
    background: var(--surf-primary);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    color: white;
}

.surf-avatar-chip.surf-avatar-more:hover {
    background: var(--surf-primary);
    transform: scale(1.05);
}

/* Removed expand button styles - no longer needed */

/* Avatar unread indicators removed - notifications only on chat icon */

/* Presence Cursors */
#surf-cursors-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999996;
}

.surf-cursor {
    position: absolute;
    pointer-events: none;
    transition: left 0.1s ease-out, top 0.1s ease-out;
}

.surf-cursor-pointer {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 8px solid currentColor;
    transform: rotate(-45deg);
}

.surf-cursor-name {
    margin-top: 8px;
    padding: 6px 12px;
    background: currentColor;
    color: white;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    min-width: 20px;
    text-align: center;
    display: block;
    opacity: 1;
    visibility: visible;
}


/* Branding */
.surf-branding {
    position: fixed;
    bottom: 5px;
    right: 20px;
    font-size: 11px;
    color: var(--surf-text-muted);
    z-index: 999995;
}

.surf-branding strong {
    font-weight: 600;
    color: var(--surf-text);
}

.surf-branding strong a {
    color: inherit;
    text-decoration: none;
    font-weight: inherit;
}

.surf-branding strong a:hover {
    color: inherit;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .surf-chat-drawer {
        width: 100%;
        height: 85vh;
        max-height: none;
        border-radius: var(--surf-border-radius);
        bottom: 80px;
        right: 10px;
    }
    
    .surf-widget-bar {
        right: 10px;
        bottom: 15px;
        gap: 8px;
    }
    
    .surf-avatar-dock {
        min-width: 50px;
        height: 35px;
        border-radius: 17.5px;
        padding: 0 8px 0 12px;
    }
    
    .surf-avatar-dock.multiple {
        justify-content: flex-start;
    }
    
    .surf-avatar-chip {
        width: 24px;
        height: 24px;
        font-size: 10px;
        margin-left: -6px;
    }
    
    .surf-notes-toggle {
        width: 35px;
        height: 35px;
    }
    
    .surf-notes-toggle svg {
        width: 20px;
        height: 20px;
    }
    
    .surf-draw-toggle {
        width: 35px;
        height: 35px;
    }
    
    .surf-draw-toggle svg {
        width: 20px;
        height: 20px;
    }
    
    .surf-voice-toggle {
        width: 35px;
        height: 35px;
    }
    
    .surf-voice-toggle svg {
        width: 20px;
        height: 20px;
    }
    
    /* Removed expand button responsive styles */
    
    .surf-chat-toggle {
        width: 50px;
        height: 50px;
        border: none !important;
        background: white !important;
        color: black !important;
    }
    
    .surf-friend-user {
        padding: 16px;
        gap: 14px;
    }
    
    .surf-friend-avatar {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
    
    .surf-friend-name {
        font-size: 16px;
        font-weight: 700;
    }
    
    .surf-friend-last-message {
        font-size: 14px;
        line-height: 1.3;
    }
    
    .surf-friend-time {
        font-size: 12px;
        font-weight: 500;
    }
    
    .surf-chat-tabs {
        padding: 0 12px;
        gap: 0;
        background: var(--surf-primary);
        border-radius: var(--surf-border-radius) var(--surf-border-radius) 0 0;
        overflow: visible;
        position: relative;
        z-index: 1000000;
    }
    
    #surf-social-widget .surf-chat-tab {
        padding: 11px 8px;
        font-size: 15px;
        font-weight: 600;
        color: white !important;
        overflow: visible !important;
        border-radius: 12px 12px 0 0;
        margin: 0 2px;
        position: relative !important;
        box-sizing: border-box !important;
    }
    
    #surf-social-widget .surf-chat-tab.active {
        background: white !important;
        color: var(--surf-primary) !important;
        border-radius: 12px 12px 0 0;
        margin-top: 5px;
        z-index: 1000001;
        overflow: visible;
    }
    
    
    .surf-chat-header {
        padding: 20px 16px 16px;
    }
    
    .surf-chat-title {
        font-size: 20px;
        font-weight: 700;
    }
    
    /* Guest Registration Mobile Styles */
    .surf-guest-registration {
        gap: 8px;
    }
    
    .surf-input-row {
        gap: 6px;
    }
    
    .surf-name-input, .surf-email-input {
        padding: 12px 14px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .surf-join-button {
        padding: 14px 20px;
        font-size: 16px;
        margin-top: 6px;
    }
}

/* Loading State */
.surf-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: var(--surf-text-muted);
}

.surf-loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid var(--surf-text-muted);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Friend Chat User List */
.surf-friend-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.surf-friend-user::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.surf-friend-user:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(2px);
}

.surf-friend-user:hover::before {
    left: 100%;
}

.surf-friend-user:active {
    transform: translateX(0) scale(0.98);
}

.surf-friend-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.surf-friend-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.surf-friend-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--surf-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.surf-friend-last-message {
    font-size: 14px;
    color: var(--surf-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.surf-friend-time {
    font-size: 12px;
    color: var(--surf-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Friend Chat Container */
.surf-friend-chat-container {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Collapsible Sections */
.surf-collapsible-section {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.surf-collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.surf-collapsible-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.surf-collapsible-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--surf-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.surf-collapsible-icon {
    color: var(--surf-text-muted);
    transition: transform 0.2s ease;
    transform: rotate(0deg);
}

.surf-collapsible-content {
    transition: all 0.3s ease;
    overflow: hidden;
}

.surf-collapsible-content.collapsed {
    max-height: 0;
    opacity: 0;
}

.surf-section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    margin: 0 20px;
}

.surf-empty-subsection {
    padding: 20px;
    text-align: center;
    color: var(--surf-text-muted);
    font-size: 14px;
    font-style: italic;
}

/* Empty State */
.surf-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--surf-text-muted);
    text-align: center;
}

.surf-empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.surf-empty-state p {
    font-size: 14px;
    margin: 0;
}

/* Admin Support Dashboard Styles */
.surf-admin-tickets-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    overflow-y: auto;
    /* Hide scrollbar but keep functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.surf-admin-tickets-container::-webkit-scrollbar {
    display: none; /* WebKit */
}

.surf-admin-ticket-item {
    background: #f8f9fa;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.surf-admin-ticket-item:hover {
    background: #e9ecef;
    border-color: #007cba;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.surf-admin-ticket-item.active {
    background: #f0f8ff;
    border-color: #007cba;
    box-shadow: 0 2px 8px rgba(0,124,186,0.2);
}

.surf-admin-ticket-item.unread {
    border-left: 4px solid #ffc107;
    background: #fff3cd;
}

.surf-admin-ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.surf-admin-ticket-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #1d2327;
}

.surf-unread-indicator {
    color: #000000;
    font-size: 12px;
    font-weight: bold;
}

.surf-admin-ticket-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #666;
}

.surf-ticket-count {
    background: #007cba;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

.surf-ticket-time {
    font-size: 11px;
    color: #999;
}

.surf-admin-ticket-preview {
    color: #666;
    font-size: 13px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.surf-admin-conversation {
    max-height: 400px;
    overflow-y: auto;
    padding: 5px 0 0 0;
    margin-bottom: 0;
    /* Hide scrollbar but keep functionality */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.surf-admin-conversation::-webkit-scrollbar {
    display: none; /* WebKit */
}

.surf-admin-conversation .surf-message-item {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.surf-admin-conversation .surf-message-item.admin {
    align-items: flex-end;
}

.surf-admin-conversation .surf-message-item.user {
    align-items: flex-start;
}

.surf-admin-conversation .surf-message-bubble {
    max-width: 70%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.surf-admin-conversation .surf-message-item.admin .surf-message-bubble {
    background: #007cba;
    color: white;
    border-bottom-right-radius: 4px;
}

.surf-admin-conversation .surf-message-item.user .surf-message-bubble {
    background: #f1f3f4;
    color: #1d2327;
    border-bottom-left-radius: 4px;
}

.surf-admin-conversation .surf-message-meta {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    padding: 0 8px;
}

.surf-admin-back-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0;
    padding-bottom: 10px;
}

.surf-back-arrow {
    background: #f1f3f4 !important;
    color: #1d2327 !important;
    border: 1px solid #e1e5e9 !important;
    padding: 8px 12px !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    font-size: 16px !important;
    font-weight: bold !important;
    transition: all 0.2s ease !important;
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    box-shadow: none !important;
    outline: none !important;
}

.surf-back-arrow:hover {
    background: #e8eaed !important;
    border-color: #dadce0 !important;
    color: #1d2327 !important;
}

.surf-back-arrow:focus {
    outline: none !important;
    box-shadow: none !important;
}

.surf-admin-chat-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d2327;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Sticky Notes Styles */
.surf-sticky-note {
    position: absolute;
    min-width: 200px;
    max-width: 300px;
    background: inherit !important;
    border: 2px solid;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    pointer-events: all;
    cursor: move;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    animation: noteAppear 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: top left;
}

@keyframes noteAppear {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.surf-sticky-note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 12px;
    color: #333;
}

.surf-sticky-note-content {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.4;
}

.surf-sticky-note-user {
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.surf-sticky-note-text {
    color: white;
    word-wrap: break-word;
    flex: 1;
}

.surf-sticky-note-actions {
    display: flex;
    gap: 8px;
    font-size: 11px;
}

.surf-sticky-note-actions button {
    background: rgba(255,255,255,0.8);
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 11px;
    color: #333;
    transition: all 0.2s ease;
}

.surf-sticky-note-actions button:hover {
    background: rgba(255,255,255,1);
    border-color: #999;
}


.surf-sticky-note.fade-out {
    animation: noteFadeOut 0.5s ease-out forwards;
}

@keyframes noteFadeOut {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* Note Creation Modal */
.surf-note-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.surf-note-modal-content {
    background: white;
    padding: 12px;
    border-radius: 12px;
    max-width: 350px;
    width: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalAppear 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
}

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

.surf-note-input-container {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 0;
}

.surf-note-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #007AFF;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.surf-note-input-wrapper {
    flex: 1;
    position: relative;
    background: white;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
}

#surf-note-message {
    flex: 1;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    resize: none;
    min-height: 20px;
    max-height: 80px;
    background: transparent;
    color: #333;
    height: 20px;
    overflow: hidden;
}

#surf-note-message::placeholder {
    color: #999;
}

.surf-note-send-btn {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    background: #f0f0f0 !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    color: #666 !important;
    margin-left: 8px !important;
    padding: 0 !important;
    font-size: 16px !important;
    box-shadow: none !important;
    outline: none !important;
}

.surf-note-send-btn:hover {
    background: #e0e0e0;
    color: #333;
}

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


/* Notes mode cursor */
body.notes-mode {
    cursor: crosshair !important;
}

body.notes-mode * {
    cursor: crosshair !important;
}

/* Draw mode cursor */
body.draw-mode {
    cursor: crosshair !important;
}

body.draw-mode * {
    cursor: crosshair !important;
}

/* Responsive sticky notes */
@media (max-width: 768px) {
    .surf-sticky-note {
        min-width: 150px;
        max-width: 250px;
        font-size: 13px;
    }
    
    .surf-note-modal-content {
        padding: 20px;
        margin: 20px;
    }
}

