/* Alpaca Dashboard Styles */

:root {
    /* Color Palette */
    --bone: #ddd8c4;
    --celadon: #a3c9a8;
    --cambridge-blue: #84b59f;
    --cambridge-blue-2: #69a297;
    --air-force-blue: #50808e;
    
    /* Semantic Colors */
    --color-primary: var(--cambridge-blue);
    --color-primary-hover: var(--cambridge-blue-2);
    --color-primary-active: var(--air-force-blue);
    --color-background: var(--bone);
    --color-background-secondary: #f5f3ed;
    --color-surface: #ffffff;
    --color-border: rgba(105, 162, 151, 0.2);
    --color-text: #2d3748;
    --color-text-secondary: #4a5568;
    --color-text-muted: #718096;
    
    /* Message Colors */
    --color-message-outbound: var(--color-background-secondary);
    --color-message-inbound: var(--color-surface);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--celadon), var(--cambridge-blue));
    --gradient-subtle: linear-gradient(180deg, var(--bone), #f5f3ed);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
    background: var(--color-background);
}

/* Direction is set dynamically by JavaScript based on language */
.alpaca-dashboard-wrapper[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

.alpaca-dashboard-wrapper[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

.alpaca-dashboard {
    display: flex;
    height: 100vh;
    overflow: hidden;
    direction: rtl;
}

/* Top Filter Bar */
.alpaca-filter-bar {
    background: var(--color-surface);
    padding: 16px 20px;
    border-bottom: 2px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    box-shadow: 0 2px 8px rgba(80, 128, 142, 0.08);
    font-family: inherit;
}

.alpaca-filter-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-right: 16px;
    flex-shrink: 0;
}

.alpaca-filter-logo {
    display: flex;
    align-items: center;
}

.alpaca-icon-img {
    height: 36px;
    width: auto;
}

.alpaca-logout-btn {
    background: transparent;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--air-force-blue);
    font-size: 16px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.alpaca-logout-btn:hover {
    background: var(--bone);
    border-color: var(--cambridge-blue-2);
    color: var(--cambridge-blue-2);
    transform: translateY(-1px);
}

.alpaca-logout-btn:active {
    transform: translateY(0);
}

.alpaca-filter-bar h2 {
    font-size: 20px;
    margin: 0 16px 0 0;
    color: var(--air-force-blue);
    flex-shrink: 0;
    font-weight: 600;
    font-family: inherit;
}

.alpaca-filter-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.alpaca-filter-label {
    font-size: 13px;
    color: var(--color-text-secondary);
    font-weight: 500;
    font-family: inherit;
}

.alpaca-filter-select {
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 14px;
    background: var(--color-surface);
    cursor: pointer;
    min-width: 150px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.alpaca-filter-select option {
    font-family: inherit;
}

.alpaca-filter-select:hover {
    border-color: var(--cambridge-blue);
    box-shadow: 0 2px 4px rgba(132, 181, 159, 0.1);
}

.alpaca-filter-select:focus {
    outline: none;
    border-color: var(--cambridge-blue-2);
    box-shadow: 0 0 0 3px rgba(132, 181, 159, 0.15);
}

.alpaca-filter-clear {
    padding: 8px 16px;
    background: var(--color-background-secondary);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: auto;
    color: var(--color-text-secondary);
    font-family: inherit;
}

.alpaca-filter-clear:hover {
    background: var(--bone);
    border-color: var(--cambridge-blue);
    color: var(--air-force-blue);
}

.alpaca-main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar - Conversations List */
.alpaca-sidebar {
    width: 360px;
    background: var(--color-surface);
    border-left: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    order: 1;
}

.alpaca-sidebar-header {
    padding: 16px 20px;
    background: var(--color-background-secondary);
    border-bottom: 1px solid var(--color-border);
}

.alpaca-sidebar-header h2 {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--air-force-blue);
    font-weight: 600;
}

.alpaca-search {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background: var(--color-surface);
    transition: all 0.2s ease;
}

.alpaca-search:focus {
    border-color: var(--cambridge-blue);
    box-shadow: 0 0 0 3px rgba(132, 181, 159, 0.15);
}

.alpaca-filters {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.alpaca-filter-btn {
    padding: 6px 12px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--color-text-secondary);
}

.alpaca-filter-btn:hover {
    background: var(--color-background-secondary);
    border-color: var(--cambridge-blue);
}

.alpaca-filter-btn.active {
    background: var(--gradient-primary);
    color: #fff;
    border-color: var(--cambridge-blue);
}

.alpaca-conversations-list {
    flex: 1;
    overflow-y: auto;
    /* Smooth scrolling */
    scroll-behavior: smooth;
    /* Hardware acceleration for better performance */
    transform: translateZ(0);
    -webkit-overflow-scrolling: touch;
}

.alpaca-conversation-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(221, 216, 196, 0.3);
    transition: all 0.2s ease;
    will-change: transform;
}

.alpaca-conversation-item:hover {
    background: var(--color-background-secondary);
    transform: translateX(-2px);
}

.alpaca-conversation-item.active {
    background: linear-gradient(90deg, rgba(163, 201, 168, 0.15), rgba(132, 181, 159, 0.1));
    border-right: 3px solid var(--cambridge-blue);
}

.alpaca-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 18px;
    flex-shrink: 0;
    margin-left: 12px;
    box-shadow: 0 2px 8px rgba(132, 181, 159, 0.3);
}

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

.alpaca-conversation-info {
    flex: 1;
    min-width: 0;
}

.alpaca-conversation-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.alpaca-contact-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--color-text);
}

.alpaca-timestamp {
    font-size: 12px;
    color: var(--color-text-muted);
}

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

.alpaca-channel-badges {
    display: inline-flex;
    gap: 4px;
    margin-right: 8px;
    align-items: center;
}

.alpaca-channel-icon-circle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
}

.alpaca-channel-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    vertical-align: middle;
}

/* Chat Area */
.alpaca-chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--gradient-subtle);
    order: 2;
    min-width: 0;
}

/* Contact Info Panel */
.alpaca-contact-panel {
    width: 320px;
    background: var(--color-surface);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    order: 3;
    overflow-y: auto;
}

.alpaca-contact-panel-header {
    padding: 16px 20px;
    background: var(--color-background-secondary);
    border-bottom: 1px solid var(--color-border);
}

.alpaca-contact-panel-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--air-force-blue);
    font-weight: 600;
}

.alpaca-contact-panel-avatar {
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.alpaca-client-assignment {
    padding: 16px 20px;
    background: var(--color-background-secondary);
    border-bottom: 1px solid var(--color-border);
}

.alpaca-client-label {
    display: block;
    font-size: 13px;
    color: var(--color-text-secondary);
    font-weight: 600;
    margin-bottom: 8px;
}

.alpaca-client-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 14px;
    background: var(--color-surface);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--color-text);
}

.alpaca-client-select:hover {
    border-color: var(--cambridge-blue);
    box-shadow: 0 2px 4px rgba(132, 181, 159, 0.1);
}

.alpaca-client-select:focus {
    outline: none;
    border-color: var(--cambridge-blue-2);
    box-shadow: 0 0 0 3px rgba(132, 181, 159, 0.15);
}

.alpaca-contact-details-list {
    padding: 20px;
}

.alpaca-contact-detail-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(221, 216, 196, 0.3);
}

.alpaca-contact-detail-item i {
    width: 20px;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 2px;
}

.alpaca-detail-label {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 2px;
}

.alpaca-detail-value {
    font-size: 14px;
    color: var(--color-text);
    font-weight: 500;
}

.alpaca-contact-channels {
    padding: 20px;
    border-bottom: 1px solid var(--color-border);
}

.alpaca-contact-channels h4 {
    font-size: 14px;
    color: var(--air-force-blue);
    margin-bottom: 12px;
    font-weight: 600;
}

.alpaca-channels-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.alpaca-channel-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--color-background-secondary);
    border-radius: 6px;
    border-right: 3px solid;
    font-size: 13px;
}

.alpaca-conversation-meta {
    padding: 20px;
}

.alpaca-conversation-meta h4 {
    font-size: 14px;
    color: var(--air-force-blue);
    margin-bottom: 12px;
    font-weight: 600;
}

.alpaca-meta-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(221, 216, 196, 0.3);
    font-size: 13px;
}

.alpaca-meta-label {
    color: var(--color-text-muted);
}

.alpaca-meta-value {
    color: var(--color-text);
    font-weight: 500;
}

/* Contact Edit Styles */
.alpaca-contact-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alpaca-btn-edit {
    background: transparent;
    border: none;
    color: var(--cambridge-blue-2);
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.alpaca-btn-edit:hover {
    background: rgba(132, 181, 159, 0.1);
    color: var(--air-force-blue);
}

.alpaca-btn-edit i {
    font-size: 13px;
}

.alpaca-btn-delete {
    background: #dc3545;
    border: none;
    color: white;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.alpaca-btn-delete:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.alpaca-btn-delete i {
    font-size: 13px;
}

.alpaca-danger-zone {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #dc3545;
    border-radius: 8px;
    background-color: #fff5f5;
}

.alpaca-danger-zone h4 {
    color: #dc3545;
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
}

.alpaca-btn-delete-conversation {
    width: 100%;
    padding: 10px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.alpaca-btn-delete-conversation:hover {
    background-color: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.alpaca-btn-delete-conversation i {
    margin-left: 8px;
}

.alpaca-edit-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 14px;
    background: var(--color-surface);
    color: var(--color-text);
    transition: all 0.2s ease;
}

.alpaca-edit-input:focus {
    outline: none;
    border-color: var(--cambridge-blue-2);
    box-shadow: 0 0 0 3px rgba(132, 181, 159, 0.15);
}

.alpaca-edit-input::placeholder {
    color: var(--color-text-muted);
}

.alpaca-edit-name {
    max-width: 250px;
}

.alpaca-contact-edit-actions {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--color-border);
    background: var(--color-background-secondary);
}

.alpaca-contact-edit-actions button {
    flex: 1;
}

.alpaca-btn-secondary {
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
}

.alpaca-btn-secondary:hover {
    background: var(--color-background-secondary);
    border-color: var(--color-text-secondary);
}

.alpaca-chat-header {
    padding: 12px 20px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(80, 128, 142, 0.05);
}

.alpaca-chat-header-info {
    display: flex;
    align-items: center;
}

.alpaca-chat-header-info .alpaca-avatar {
    width: 40px;
    height: 40px;
    margin-left: 12px;
}

.alpaca-contact-details h3 {
    font-size: 16px;
    color: var(--air-force-blue);
    font-weight: 600;
}

.alpaca-contact-details p {
    font-size: 13px;
    color: var(--color-text-secondary);
}

.alpaca-status-selector {
    margin-right: auto;
}

.alpaca-status-dropdown {
    padding: 6px 10px 6px 32px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: var(--color-surface);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--color-text);
    background-repeat: no-repeat;
    background-position: 8px center;
    background-size: 16px 16px;
}

.alpaca-status-dropdown[value="open"] {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2369a297"><circle cx="12" cy="12" r="10"/></svg>');
}

.alpaca-status-dropdown[value="pending"] {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23f6ad55"><circle cx="12" cy="12" r="10"/></svg>');
}

.alpaca-status-dropdown[value="resolved"] {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23a3c9a8"><circle cx="12" cy="12" r="10"/></svg>');
}

.alpaca-status-dropdown[value="closed"] {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23718096"><circle cx="12" cy="12" r="10"/></svg>');
}

.alpaca-status-dropdown[value="cancelled"] {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23fc8181"><circle cx="12" cy="12" r="10"/></svg>');
}

.alpaca-status-dropdown:hover {
    border-color: var(--cambridge-blue);
}

.alpaca-status-dropdown:focus {
    outline: none;
    border-color: var(--cambridge-blue);
    box-shadow: 0 0 0 3px rgba(132, 181, 159, 0.15);
}

.alpaca-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    /* Smooth scrolling */
    scroll-behavior: smooth;
    /* Hardware acceleration */
    transform: translateZ(0);
    -webkit-overflow-scrolling: touch;
}

.alpaca-message {
    display: flex;
    margin-bottom: 8px;
    animation: fadeInMessage 0.3s ease;
}

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

.alpaca-message.outbound {
    justify-content: flex-end;
}

.alpaca-message-bubble {
    max-width: 65%;
    padding: 8px 12px;
    border-radius: 8px;
    position: relative;
}

.alpaca-message.inbound .alpaca-message-bubble {
    background: var(--color-message-inbound);
    border-bottom-right-radius: 2px;
    box-shadow: 0 1px 4px rgba(80, 128, 142, 0.15);
    border: 1px solid rgba(132, 181, 159, 0.1);
}

.alpaca-message.outbound .alpaca-message-bubble {
    background: var(--color-message-outbound);
    border-bottom-left-radius: 2px;
    box-shadow: 0 1px 4px rgba(105, 162, 151, 0.25);
    border: 1px solid rgba(105, 162, 151, 0.15);
}

.alpaca-message-content {
    font-size: 14px;
    color: #1a202c;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.5;
    font-weight: 400;
}

.alpaca-message-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 4px;
    font-size: 11px;
    color: var(--color-text-muted);
}

.alpaca-message-channel-icon {
    font-size: 10px;
    opacity: 0.7;
}

.alpaca-message-status {
    font-size: 10px;
}

/* Composer */
.alpaca-composer {
    padding: 12px 20px;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
}

.alpaca-channel-selector {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
}

.alpaca-channel-label {
    font-size: 13px;
    color: var(--color-text-secondary);
    font-weight: 500;
    display: block;
    margin-bottom: 8px;
}

.alpaca-channel-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.alpaca-channel-btn {
    padding: 8px 14px;
    border: 2px solid var(--color-border);
    background: var(--color-surface);
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    color: var(--color-text);
    position: relative;
}

.alpaca-channel-btn:hover {
    background: var(--color-background-secondary);
    border-color: var(--cambridge-blue);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(132, 181, 159, 0.15);
}

.alpaca-channel-btn.active {
    background: var(--color-background-secondary);
    border-color: var(--cambridge-blue);
    border-width: 2px;
    font-weight: 500;
    box-shadow: 0 0 0 3px rgba(132, 181, 159, 0.15);
}

.alpaca-channel-btn.active::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid var(--cambridge-blue);
    border-radius: 6px;
    pointer-events: none;
}

.alpaca-composer-inner {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 8px 12px;
    transition: all 0.2s ease;
}

.alpaca-composer-inner:focus-within {
    border-color: var(--cambridge-blue);
    box-shadow: 0 0 0 3px rgba(132, 181, 159, 0.1);
}

.alpaca-composer-textarea {
    flex: 1;
    border: none;
    outline: none;
    resize: none;
    font-size: 15px;
    font-family: inherit;
    max-height: 150px;
    min-height: 24px;
}

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

.alpaca-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.alpaca-btn-primary {
    background: var(--gradient-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(132, 181, 159, 0.3);
}

.alpaca-btn-primary:hover {
    background: var(--cambridge-blue-2);
    box-shadow: 0 4px 12px rgba(105, 162, 151, 0.4);
    transform: translateY(-1px);
}

.alpaca-btn-primary:active {
    background: var(--air-force-blue);
    transform: translateY(0);
}

.alpaca-btn-primary:disabled {
    background: var(--bone);
    color: var(--color-text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

.alpaca-btn-icon {
    padding: 8px;
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.alpaca-btn-icon:hover {
    opacity: 1;
}

/* Empty State */
.alpaca-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
}

.alpaca-empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.alpaca-empty-state h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.alpaca-empty-state p {
    font-size: 14px;
}

/* Loading */
.alpaca-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    animation: fadeIn 0.3s ease;
}

.alpaca-spinner {
    border: 3px solid var(--bone);
    border-top: 3px solid var(--cambridge-blue);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Scrollbar */
.alpaca-conversations-list::-webkit-scrollbar,
.alpaca-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.alpaca-conversations-list::-webkit-scrollbar-thumb,
.alpaca-chat-messages::-webkit-scrollbar-thumb {
    background: var(--cambridge-blue);
    border-radius: 3px;
}

.alpaca-conversations-list::-webkit-scrollbar-thumb:hover,
.alpaca-chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--cambridge-blue-2);
}

.alpaca-conversations-list::-webkit-scrollbar-track,
.alpaca-chat-messages::-webkit-scrollbar-track {
    background: var(--color-background-secondary);
}

/* Performance optimizations */
.alpaca-dashboard * {
    /* Better text rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Smooth transitions for all interactive elements */
.alpaca-filter-select,
.alpaca-filter-clear,
.alpaca-btn,
.alpaca-search {
    transition: all 0.2s ease;
}

/* Prevent layout shifts during updates */
.alpaca-conversation-info,
.alpaca-message-bubble {
    contain: layout;
}

/* Responsive */
@media (max-width: 1200px) {
    .alpaca-contact-panel {
        display: none;
    }
}

@media (max-width: 768px) {
    .alpaca-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .alpaca-filter-bar h2 {
        margin-bottom: 12px;
    }
    
    .alpaca-filter-group {
        width: 100%;
    }
    
    .alpaca-filter-select {
        width: 100%;
    }
    
    .alpaca-sidebar {
        width: 100%;
        border-left: none;
    }
    
    .alpaca-chat-area,
    .alpaca-contact-panel {
        display: none;
    }
    
    .alpaca-dashboard.chat-open .alpaca-sidebar {
        display: none;
    }
    
    .alpaca-dashboard.chat-open .alpaca-chat-area {
        display: flex;
        width: 100%;
    }
}

/* Print Styles */
@media print {
    .alpaca-sidebar,
    .alpaca-composer,
    .alpaca-filter-bar {
        display: none;
    }
    
    .alpaca-chat-area {
        width: 100%;
    }
    
    .alpaca-chat-messages {
        overflow: visible;
    }
}

