/* SmartChat Widget - Premium iOS Design with Beautiful Gradients */

/* CSS Variables for luxurious iOS-inspired theming */
:root {
    /* Gradient palette */
    --gradient-blue: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
    --gradient-purple: linear-gradient(135deg, #9733EE 0%, #DA22FF 100%);
    --gradient-peach: linear-gradient(135deg, #f8b195 0%, #f67280 100%);
    --gradient-mint: linear-gradient(135deg, #2AFADF 0%, #4C83FF 100%);
    --gradient-sunset: linear-gradient(135deg, #FF416C 0%, #FF9677 100%);
    --gradient-morning: linear-gradient(135deg, #F2994A 0%, #F2C94C 100%);
    --gradient-royal: linear-gradient(135deg, #141e30 0%, #243b55 100%);
    --gradient-cosmic: linear-gradient(135deg, #0F2027 0%, #203A43 50%, #2C5364 100%);
    --gradient-gold: linear-gradient(135deg, #BF953F 0%, #FCF6BA 50%, #B38728 100%);
    --gradient-royal-dark: linear-gradient(135deg, #000000 0%, #1A1A1A 100%);

    /* iOS color palette */
    --ios-blue: #0A84FF;
    --ios-indigo: #5E5CE6;
    --ios-purple: #BF5AF2;
    --ios-pink: #FF2D55;
    --ios-red: #FF3B30;
    --ios-orange: #FF9F0A;
    --ios-yellow: #FFCC00;
    --ios-green: #34C759;
    --ios-mint: #00C7BE;
    --ios-teal: #30B0C7;
    --ios-cyan: #32ADE6;
    --ios-blue-gray: #8E8E93;

    /* Background colors */
    --ios-light-bg: #F2F2F7;
    --ios-lighter-bg: #FFFFFF;
    --ios-dark-bg: #1C1C1E;
    --ios-darker-bg: #000000;

    /* Separator colors */
    --ios-light-separator: rgba(60, 60, 67, 0.1);
    --ios-dark-separator: rgba(84, 84, 88, 0.65);

    /* Functional colors */
    --smartchat-primary-color: var(--ios-blue);
    --smartchat-secondary-color: var(--ios-blue-gray);
    --smartchat-success-color: var(--ios-green);
    --smartchat-danger-color: var(--ios-red);
    --smartchat-warning-color: var(--ios-orange);
    --smartchat-info-color: var(--ios-teal);

    /* Backgrounds */
    --smartchat-bg-primary: var(--ios-lighter-bg);
    --smartchat-bg-secondary: var(--ios-light-bg);

    /* Text colors */
    --smartchat-text-primary: #000000;
    --smartchat-text-secondary: #3C3C43;
    --smartchat-text-tertiary: #8E8E93;
    --smartchat-text-light: #FFFFFF;

    /* iOS-style borders and shadows */
    --smartchat-border-color: var(--ios-light-separator);
    --smartchat-shadow: 0 2px 14px rgba(0, 0, 0, 0.1);
    --smartchat-shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);

    /* San Francisco font stack */
    --smartchat-font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, sans-serif;
    --smartchat-font-size-xs: 0.75rem;
    --smartchat-font-size-sm: 0.875rem;
    --smartchat-font-size: 1rem;
    --smartchat-font-size-lg: 1.125rem;
    --smartchat-font-size-xl: 1.25rem;

    /* iOS-style rounded corners */
    --smartchat-border-radius-sm: 8px;
    --smartchat-border-radius: 12px;
    --smartchat-border-radius-lg: 16px;
    --smartchat-border-radius-xl: 22px;
    --smartchat-border-radius-full: 9999px;

    --smartchat-z-index: 1050;
    --smartchat-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Widget Container */
.smartchat-widget {
    position: fixed;
    z-index: var(--smartchat-z-index);
    font-family: var(--smartchat-font-family);
    font-size: var(--smartchat-font-size);
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Position Variants */
.smartchat-position-bottom-right {
    bottom: 16px;
    right: 16px;
}

.smartchat-position-bottom-left {
    bottom: 16px;
    left: 16px;
}

.smartchat-position-top-right {
    top: 16px;
    right: 16px;
}

.smartchat-position-top-left {
    top: 16px;
    left: 16px;
}

/* Beautiful Gradient Toggle Button */
.smartchat-toggle {
    width: 56px;
    height: 56px;
    background: var(--gradient-blue);
    border-radius: 28px;
    cursor: pointer;
    box-shadow: var(--smartchat-shadow-lg);
    transition: var(--smartchat-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
}

.smartchat-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-mint);
    opacity: 0;
    transition: opacity 0.5s ease;
    border-radius: 28px;
}

.smartchat-toggle:hover::before {
    opacity: 1;
}

.smartchat-toggle.active {
    background: var(--gradient-purple);
}

/* Stylish animated icon */
.smartchat-icon {
    width: 24px;
    height: 24px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="white" viewBox="0 0 24 24"><path d="M20 2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h4v4l6-4h6c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2z"/></svg>');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    z-index: 1;
}

/* iOS notification badge with animation */
.smartchat-unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--ios-red);
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(255, 59, 48, 0.4);
    animation: smartchat-pulse 2s infinite;
    z-index: 2;
}

@keyframes smartchat-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); box-shadow: 0 2px 8px rgba(255, 59, 48, 0.6); }
    100% { transform: scale(1); }
}

/* Beautiful Gradient Chat Window */
.smartchat-window {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: var(--chat-width, 360px);
    height: var(--chat-height, 560px);
    background: var(--smartchat-bg-primary);
    border-radius: var(--smartchat-border-radius-lg);
    box-shadow: var(--smartchat-shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: smartchat-slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

@keyframes smartchat-slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Position adjustments for chat window */
.smartchat-position-bottom-left .smartchat-window {
    right: auto;
    left: 0;
}

.smartchat-position-top-right .smartchat-window,
.smartchat-position-top-left .smartchat-window {
    bottom: auto;
    top: 70px;
}

/* Size Variants */
.smartchat-size-small .smartchat-window {
    width: var(--chat-width, 320px);
    height: var(--chat-height, 450px);
}

.smartchat-size-large .smartchat-window {
    width: var(--chat-width, 420px);
    height: var(--chat-height, 650px);
}

/* Elegant Gradient Header */
.smartchat-header {
    background: var(--gradient-blue);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.smartchat-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    mask-image: linear-gradient(45deg, rgba(0, 0, 0, 0.2) 25%, transparent 25%, transparent 50%, rgba(0, 0, 0, 0.2) 50%, rgba(0, 0, 0, 0.2) 75%, transparent 75%, transparent);
    mask-size: 10px 10px;
}

.smartchat-title {
    font-weight: 700;
    font-size: var(--smartchat-font-size-lg);
    letter-spacing: -0.01em;
    position: relative;
    z-index: 1;
}

.smartchat-status {
    font-size: var(--smartchat-font-size-sm);
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.smartchat-header-actions {
    display: flex;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.smartchat-minimize-btn,
.smartchat-close-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: none;
    color: white;
    font-size: 16px;
    width: 28px;
    height: 28px;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.smartchat-minimize-btn:hover,
.smartchat-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* Enhanced Messages Container with subtle gradient background */
.smartchat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: linear-gradient(180deg, rgba(248, 248, 252, 1) 0%, rgba(240, 240, 250, 1) 100%);
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.smartchat-messages::-webkit-scrollbar {
    width: 6px;
}

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

.smartchat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.smartchat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Add subtle pattern to chat background */
.smartchat-messages::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23000000' fill-opacity='0.02' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.5;
    z-index: -1;
}

/* Beautiful iOS-style Message Bubbles */
.smartchat-message {
    margin-bottom: 16px;
    max-width: 85%;
    word-wrap: break-word;
    animation: smartchat-message-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: bottom center;
}

@keyframes smartchat-message-pop {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.smartchat-message-sent {
    margin-left: auto;
    text-align: right;
}

.smartchat-message-received {
    margin-right: auto;
}

.smartchat-message-content {
    padding: 12px 16px;
    border-radius: 20px;
    display: inline-block;
    max-width: 100%;
    font-size: var(--smartchat-font-size);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    line-height: 1.4;
}

.smartchat-message-sent .smartchat-message-content {
    background: var(--gradient-blue);
    color: white;
    border-bottom-right-radius: 4px;
}

.smartchat-message-received .smartchat-message-content {
    background: white;
    color: var(--smartchat-text-primary);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.smartchat-message-sender {
    font-size: var(--smartchat-font-size-xs);
    color: var(--smartchat-text-tertiary);
    margin-bottom: 4px;
    font-weight: 500;
}

.smartchat-message-time {
    font-size: 0.7rem;
    color: rgba(142, 142, 147, 0.8);
    margin-top: 5px;
    font-weight: 500;
}

.smartchat-welcome-message .smartchat-message-content {
    background: var(--gradient-peach);
    color: white;
}

/* Message content formatting */
.smartchat-message-content a {
    color: #0078d7;
    text-decoration: none;
    word-break: break-word;
}

.smartchat-message-content a:hover {
    text-decoration: underline;
}

.smartchat-message-sent .smartchat-message-content a {
    color: #ffffff;
    text-decoration: underline;
}

.smartchat-message-content ul,
.smartchat-message-content ol {
    padding-left: 20px;
    margin: 5px 0;
    text-align: left;
}

.smartchat-message-content h1,
.smartchat-message-content h2,
.smartchat-message-content h3,
.smartchat-message-content h4 {
    margin: 10px 0 5px 0;
    font-weight: bold;
}

/* Stylish Typing Indicator */
.smartchat-typing-indicator {
    padding: 10px 15px;
    color: var(--smartchat-text-secondary);
    font-style: italic;
    font-size: var(--smartchat-font-size-sm);
    display: flex;
    align-items: center;
    gap: 6px;
}

.smartchat-typing-dots {
    display: flex;
    gap: 3px;
}

.smartchat-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ios-blue);
    animation: smartchat-typing-bounce 1.4s infinite;
}

.smartchat-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.smartchat-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

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

/* Beautiful Input Area with glassmorphism effect */
.smartchat-input-area {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: rgba(248, 248, 252, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    gap: 10px;
}

.smartchat-emoji-btn {
    background: rgba(10, 132, 255, 0.1);
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--smartchat-border-radius-full);
    transition: all 0.2s ease;
    color: var(--ios-blue);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
}

.smartchat-emoji-btn:hover {
    background: rgba(10, 132, 255, 0.2);
    transform: scale(1.05);
}

/* Beautiful Message Input with shadow effect */
.smartchat-message-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 24px;
    font-size: var(--smartchat-font-size);
    resize: none;
    outline: none;
    transition: all 0.2s ease;
    background: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    font-family: var(--smartchat-font-family);
    max-height: 120px;
}

.smartchat-message-input:focus {
    border-color: var(--ios-blue);
    box-shadow: 0 2px 12px rgba(10, 132, 255, 0.15);
}

/* Beautiful Send Button with gradient */
.smartchat-send-btn {
    background: var(--gradient-blue);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(10, 132, 255, 0.3);
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
}

.smartchat-send-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-mint);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 20px;
}

.smartchat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(10, 132, 255, 0.4);
}

.smartchat-send-btn:hover::before {
    opacity: 1;
}

.smartchat-send-btn svg {
    width: 18px;
    height: 18px;
    position: relative;
    z-index: 1;
}

.smartchat-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Send button icon */
.smartchat-send-icon {
    width: 18px;
    height: 18px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M2.01 21L23 12 2.01 3 2 10l15 2-15 2z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    z-index: 1;
}

/* Emoji Picker with glassmorphism */
.smartchat-emoji-picker {
    position: absolute;
    bottom: 70px;
    left: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--smartchat-border-radius);
    padding: 15px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
    gap: 8px;
    animation: smartchat-fadeIn 0.2s ease-out;
}

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

.smartchat-emoji-item {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--smartchat-border-radius);
    transition: all 0.2s ease;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.smartchat-emoji-item:hover {
    background: rgba(0, 0, 0, 0.05);
    transform: scale(1.1);
}

/* File Upload Button */
.smartchat-file-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: var(--smartchat-border-radius);
    transition: background-color 0.2s ease;
    color: var(--smartchat-secondary-color);
}

.smartchat-file-btn:hover {
    background: var(--smartchat-bg-secondary);
}

/* File Upload Progress */
.smartchat-file-progress {
    padding: 10px 15px;
    background: var(--smartchat-bg-secondary);
    border-top: 1px solid var(--smartchat-border-color);
}

.file-upload-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    margin: 5px 0;
}

.progress-text {
    font-size: 12px;
    color: var(--smartchat-text-secondary);
    margin-bottom: 5px;
}

.progress-bar {
    height: 4px;
    width: 100%;
    background: var(--smartchat-border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-fill {
    height: 100%;
    background: var(--smartchat-primary-color);
    transition: width 0.3s ease;
}

/* File Message Styles */
.file-message-content {
    max-width: 300px !important;
    padding: 0 !important;
}

.file-message-container {
    border: 1px solid var(--smartchat-border-color);
    border-radius: var(--smartchat-border-radius);
    overflow: hidden;
    background: var(--smartchat-bg-primary);
    max-width: 100%;
    margin: 5px 0;
}

.file-download-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.file-download-link:hover {
    text-decoration: none;
    color: inherit;
}

.file-download-link:hover .file-message-container {
    background: var(--smartchat-bg-secondary);
}

/* Image Preview Styles */
.image-preview {
    position: relative;
    max-height: 200px;
    overflow: hidden;
}

.image-preview-container {
    position: relative;
    display: inline-block;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}

.chat-image,
.chat-image-preview {
    width: 100%;
    height: auto;
    display: block;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
    cursor: pointer;
}

.chat-image-preview:hover {
    transform: scale(1.02);
}

.image-overlay {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.image-preview-container:hover .image-overlay {
    opacity: 1;
}

/* File Info Styles */
.file-info {
    padding: 12px;
}

.file-info-small {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    display: none; /* Hidden for images */
}

.file-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-weight: 600;
}

.file-header i {
    font-size: 18px;
    color: var(--smartchat-primary-color);
}

.file-name {
    font-weight: 600;
    color: var(--smartchat-text-primary);
    word-break: break-word;
}

.file-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--smartchat-text-secondary);
    margin-bottom: 8px;
}

.file-size {
    font-weight: 500;
}

.file-expiration {
    color: var(--smartchat-warning-color);
    font-weight: 500;
}

/* PDF File Container */
.pdf-file-container {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
    max-width: 300px;
}

.pdf-icon-container {
    margin-right: 12px;
    flex-shrink: 0;
}

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

.file-actions .btn {
    padding: 4px 8px;
    font-size: 11px;
    text-decoration: none;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-outline-primary {
    color: #007bff;
    border: 1px solid #007bff;
    background: transparent;
}

.btn-outline-primary:hover {
    background: #007bff;
    color: white;
}

.btn-outline-secondary {
    color: #6c757d;
    border: 1px solid #6c757d;
    background: transparent;
}

.btn-outline-secondary:hover {
    background: #6c757d;
    color: white;
}

/* Deleted/Not Found File Messages */
.file-deleted-message,
.file-not-found-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--smartchat-bg-secondary);
    border: 1px dashed var(--smartchat-border-color);
    border-radius: var(--smartchat-border-radius);
    color: var(--smartchat-text-secondary);
    font-style: italic;
    text-align: center;
    font-size: 13px;
}

.file-deleted-message {
    background: #f8d7da;
    color: #721c24;
}

.file-not-found-message {
    background: #fff3cd;
    color: #856404;
}

.file-deleted-message i,
.file-not-found-message i {
    color: var(--smartchat-secondary-color);
}

/* Guest Form with gradient */
.smartchat-guest-form {
    padding: 24px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(249, 249, 255, 0.95) 100%);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    z-index: 1060;
}

.smartchat-guest-form h4 {
    margin: 0 0 20px 0;
    color: var(--smartchat-text-primary);
    font-size: var(--smartchat-font-size-lg);
    font-weight: 700;
    text-align: center;
}

.smartchat-form-group {
    margin-bottom: 16px;
}

.smartchat-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--smartchat-border-radius);
    font-size: var(--smartchat-font-size);
    transition: all 0.2s ease;
    box-sizing: border-box;
    background: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

.smartchat-input:focus {
    outline: none;
    border-color: var(--ios-blue);
    box-shadow: 0 2px 10px rgba(10, 132, 255, 0.15);
}

.smartchat-btn {
    padding: 12px 20px;
    border: none;
    border-radius: var(--smartchat-border-radius);
    cursor: pointer;
    font-size: var(--smartchat-font-size);
    font-weight: 600;
    transition: all 0.2s ease;
    text-align: center;
    display: inline-block;
    text-decoration: none;
    user-select: none;
}

.smartchat-btn-primary {
    background: var(--gradient-blue);
    color: white;
    width: 100%;
    box-shadow: 0 4px 10px rgba(10, 132, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.smartchat-btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-mint);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.smartchat-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(10, 132, 255, 0.4);
}

.smartchat-btn-primary:hover::before {
    opacity: 1;
}

.smartchat-btn-primary span {
    position: relative;
    z-index: 1;
}

/* Theme Variants */
.smartchat-theme-dark {
    --smartchat-bg-primary: var(--ios-dark-bg);
    --smartchat-bg-secondary: #2C2C2E;
    --smartchat-text-primary: #FFFFFF;
    --smartchat-text-secondary: #EBEBF5;
    --smartchat-text-tertiary: rgba(235, 235, 245, 0.6);
    --smartchat-border-color: rgba(255, 255, 255, 0.1);
}

.smartchat-theme-dark .smartchat-messages {
    background: linear-gradient(180deg, #1C1C1E 0%, #2C2C2E 100%);
}

.smartchat-theme-dark .smartchat-message-received .smartchat-message-content {
    background: #3A3A3C;
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.smartchat-theme-dark .smartchat-input-area {
    background: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.smartchat-theme-dark .smartchat-message-input {
    background: #3A3A3C;
    color: white;
    border-color: rgba(255, 255, 255, 0.1);
}

.smartchat-theme-dark .smartchat-emoji-btn {
    background: rgba(10, 132, 255, 0.2);
}

/* Luxury Theme */
.smartchat-theme-luxury .smartchat-toggle {
    background: var(--gradient-gold);
}

.smartchat-theme-luxury .smartchat-header {
    background: var(--gradient-royal-dark);
}

.smartchat-theme-luxury .smartchat-message-sent .smartchat-message-content {
    background: var(--gradient-gold);
    color: #000;
    font-weight: 500;
}

.smartchat-theme-luxury .smartchat-send-btn {
    background: var(--gradient-gold);
    color: #000;
}

.smartchat-theme-luxury .smartchat-btn-primary {
    background: var(--gradient-gold);
    color: #000;
    font-weight: 600;
}

/* Sunset Theme */
.smartchat-theme-sunset .smartchat-toggle {
    background: var(--gradient-sunset);
}

.smartchat-theme-sunset .smartchat-header {
    background: var(--gradient-sunset);
}

.smartchat-theme-sunset .smartchat-message-sent .smartchat-message-content {
    background: var(--gradient-sunset);
}

.smartchat-theme-sunset .smartchat-send-btn {
    background: var(--gradient-sunset);
}

.smartchat-theme-sunset .smartchat-btn-primary {
    background: var(--gradient-sunset);
}

/* Animations and Window States */
.smartchat-window.minimized {
    height: 60px !important;
    overflow: hidden;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.smartchat-window.minimized .smartchat-messages,
.smartchat-window.minimized .smartchat-input-area,
.smartchat-window.minimized .smartchat-guest-form {
    display: none;
}

/* Loading States */
.smartchat-loading {
    position: relative;
}

.smartchat-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 2px solid rgba(10, 132, 255, 0.2);
    border-top-color: var(--ios-blue);
    border-radius: 50%;
    animation: smartchat-spin 1s linear infinite;
    box-shadow: 0 0 10px rgba(10, 132, 255, 0.1);
}

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

/* Glow effects for buttons */
.smartchat-send-btn::after,
.smartchat-toggle::after,
.smartchat-btn-primary::after {
    content: '';
    position: absolute;
    top: -10%;
    left: -10%;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.smartchat-send-btn:hover::after,
.smartchat-toggle:hover::after,
.smartchat-btn-primary:hover::after {
    opacity: 1;
}

/* Utility Classes */
.smartchat-glass-effect {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--smartchat-border-radius);
}

.smartchat-theme-dark .smartchat-glass-effect {
    background: rgba(30, 30, 30, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.smartchat-hover-effect {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.smartchat-hover-effect:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .smartchat-toggle {
        position: fixed;
        bottom: 20px;
        right: 20px;
        z-index: calc(var(--smartchat-z-index) + 1);
    }

    .smartchat-toggle.active {
        opacity: 0;
    }

    .smartchat-window {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100% !important;
        height: 100% !important;
        border-radius: 0;
        animation: smartchat-fade 0.25s ease-out;
    }

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

    .file-message-content {
        max-width: 250px !important;
    }

    .image-preview {
        max-height: 150px;
    }

    .chat-image {
        max-height: 150px;
    }
}

/* Accessibility and Motion Preferences */
@media (prefers-reduced-motion: reduce) {
    .smartchat-widget * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .smartchat-messages {
        scroll-behavior: auto;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .smartchat-messages {
        scroll-behavior: smooth;
    }
}

/* Focus styles for accessibility */
.smartchat-widget *:focus-visible {
    outline: 2px solid var(--ios-blue);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .smartchat-widget {
        --smartchat-border-color: #000000;
        --smartchat-shadow: 0 0 0 2px #000000;
    }
}

/* Auto dark mode support */
@media (prefers-color-scheme: dark) {
    .smartchat-theme-auto {
        --smartchat-bg-primary: var(--ios-dark-bg);
        --smartchat-bg-secondary: #2C2C2E;
        --smartchat-text-primary: #FFFFFF;
        --smartchat-text-secondary: #EBEBF5;
        --smartchat-text-tertiary: rgba(235, 235, 245, 0.6);
        --smartchat-border-color: rgba(255, 255, 255, 0.1);
    }

    .smartchat-theme-auto .smartchat-messages {
        background: linear-gradient(180deg, #1C1C1E 0%, #2C2C2E 100%);
    }

    .smartchat-theme-auto .smartchat-message-received .smartchat-message-content {
        background: #3A3A3C;
        color: white;
    }

    .smartchat-theme-auto .smartchat-input-area {
        background: rgba(30, 30, 30, 0.8);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .smartchat-theme-auto .smartchat-message-input {
        background: #3A3A3C;
        color: white;
        border-color: rgba(255, 255, 255, 0.1);
    }
}