/**
 * Meridesk Frontend Styles
 */

/* Root Variables */
:root {
    --meridesk-primary: #4f46e5;
    --meridesk-primary-hover: #4338ca;
    --meridesk-secondary: #64748b;
    --meridesk-success: #10b981;
    --meridesk-error: #ef4444;
    --meridesk-warning: #f59e0b;
    --meridesk-info: #3b82f6;
    --meridesk-bg-light: #f8fafc;
    --meridesk-bg-white: #ffffff;
    --meridesk-border: #e2e8f0;
    --meridesk-text: #1e293b;
    --meridesk-text-light: #64748b;
    --meridesk-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --meridesk-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --meridesk-radius: 8px;
    --meridesk-radius-lg: 12px;
}

/* Reset & Base Styles */
.meridesk-chat-container,
.meridesk-chat-popup,
.meridesk-modal,
[class*="meridesk-"] {
    box-sizing: border-box;
}

/* ===========================
   FLOATING CHAT BUTTON
   =========================== */

#meridesk-chat-container {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

#meridesk-chat-container.meridesk-chat-bottom-right {
    bottom: 20px;
    right: 20px;
}

#meridesk-chat-container.meridesk-chat-bottom-left {
    bottom: 20px;
    left: 20px;
}

.meridesk-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--meridesk-primary);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: var(--meridesk-shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.meridesk-chat-button:hover {
    background: var(--meridesk-primary-hover);
    transform: scale(1.1);
}

.meridesk-chat-icon,
.meridesk-close-icon {
    width: 28px;
    height: 28px;
    transition: all 0.3s ease;
    position: absolute;
}

.meridesk-close-icon {
    opacity: 0;
    transform: rotate(-90deg);
}

.meridesk-chat-button.active .meridesk-chat-icon {
    opacity: 0;
    transform: rotate(90deg);
}

.meridesk-chat-button.active .meridesk-close-icon {
    opacity: 1;
    transform: rotate(0deg);
}

/* ===========================
   CHAT POPUP
   =========================== */

.meridesk-chat-popup {
    position: fixed;
    bottom: 90px;
    width: 400px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: var(--meridesk-radius-lg);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: meridesk-slide-up 0.3s ease;
}

#meridesk-chat-container.meridesk-chat-bottom-right .meridesk-chat-popup {
    right: 0;
}

#meridesk-chat-container.meridesk-chat-bottom-left .meridesk-chat-popup {
    left: 0;
}

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

.meridesk-chat-header {
    background: var(--meridesk-primary);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.meridesk-chat-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.meridesk-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meridesk-chat-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: whitesmoke;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.meridesk-chat-logo .meridesk-logo-icon {
    width: 24px;
    height: 24px;
    color: #4f46e5;
    display: block;
}

.meridesk-chat-header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.meridesk-chat-header-text p {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

.meridesk-chat-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.meridesk-chat-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.meridesk-chat-close svg {
    width: 20px;
    height: 20px;
}

/* Voice Call Button */
.meridesk-voice-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    width: 36px;
    height: 36px;
    position: relative;
}

.meridesk-voice-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.meridesk-voice-btn svg {
    width: 20px;
    height: 20px;
    transition: opacity 0.3s ease;
}

.meridesk-voice-btn .meridesk-voice-icon {
    opacity: 1;
}

.meridesk-voice-btn .meridesk-voice-active-icon {
    opacity: 0;
    position: absolute;
}

.meridesk-voice-btn.active {
    background: rgba(239, 68, 68, 0.9);
}

.meridesk-voice-btn.active:hover {
    background: rgba(239, 68, 68, 1);
}

.meridesk-voice-btn.active .meridesk-voice-icon {
    opacity: 0;
}

.meridesk-voice-btn.active .meridesk-voice-active-icon {
    opacity: 1;
}

.meridesk-voice-btn.speaking {
    animation: meridesk-pulse 1.5s ease-in-out infinite;
}

@keyframes meridesk-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 8px rgba(255, 255, 255, 0);
    }
}

.meridesk-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--meridesk-bg-light);
}

.meridesk-restored-banner {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: var(--meridesk-radius);
    padding: 12px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #92400e;
}

.meridesk-restored-banner svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.meridesk-reset-btn {
    margin-left: auto;
    padding: 4px 12px;
    background: white;
    border: 1px solid #fcd34d;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.meridesk-reset-btn:hover {
    background: #fef3c7;
}

.meridesk-chat-message {
    margin-bottom: 16px;
    display: flex;
    gap: 8px;
}

.meridesk-chat-message.user {
    flex-direction: row-reverse;
}

.meridesk-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--meridesk-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.meridesk-message-content {
    max-width: 75%;
}

.meridesk-message-bubble {
    padding: 10px 14px;
    border-radius: var(--meridesk-radius);
    font-size: 14px;
    line-height: 1.5;
}

.meridesk-chat-message.user .meridesk-message-bubble {
    background: var(--meridesk-primary);
    color: white;
}

.meridesk-chat-message.assistant .meridesk-message-bubble {
    background: white;
    color: var(--meridesk-text);
    box-shadow: var(--meridesk-shadow);
}

.meridesk-message-time {
    font-size: 11px;
    color: var(--meridesk-text-light);
    margin-top: 4px;
    padding: 0 4px;
}

/* System Messages */
.meridesk-system-message {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: var(--meridesk-radius);
    padding: 8px 12px;
    margin: 12px 0;
    text-align: center;
    font-size: 13px;
    color: #92400e;
    line-height: 1.4;
}

.meridesk-chat-input-container {
    border-top: 1px solid var(--meridesk-border);
    background: white;
}

.meridesk-chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px;
}

.meridesk-chat-input {
    flex: 1;
    border: 1px solid var(--meridesk-border);
    border-radius: var(--meridesk-radius);
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 100px;
    line-height: 1.5;
}

.meridesk-chat-input:focus {
    outline: none;
    border-color: var(--meridesk-primary);
}

.meridesk-chat-send-btn {
    width: 40px;
    height: 40px;
    background: var(--meridesk-primary);
    color: white;
    border: none;
    border-radius: var(--meridesk-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.meridesk-chat-send-btn:hover {
    background: var(--meridesk-primary-hover);
}

.meridesk-chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.meridesk-chat-send-btn svg {
    width: 20px;
    height: 20px;
}

.meridesk-chat-powered {
    padding: 8px 12px;
    text-align: center;
    font-size: 11px;
    color: var(--meridesk-text-light);
    background: var(--meridesk-bg-light);
}

.meridesk-chat-loading {
    position: absolute;
    bottom: 90px;
    left: 16px;
}

.meridesk-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: white;
    border-radius: var(--meridesk-radius);
    box-shadow: var(--meridesk-shadow);
}

.meridesk-typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--meridesk-text-light);
    border-radius: 50%;
    animation: meridesk-typing 1.4s infinite;
}

.meridesk-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.meridesk-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes meridesk-typing {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-8px);
    }
}

/* ===========================
   COMMON STYLES
   =========================== */

.meridesk-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--meridesk-radius);
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.meridesk-btn-primary {
    background: var(--meridesk-primary);
    color: white;
}

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

.meridesk-btn-secondary {
    background: var(--meridesk-bg-light);
    color: var(--meridesk-text);
    border: 1px solid var(--meridesk-border);
}

.meridesk-btn-secondary:hover {
    background: #e2e8f0;
}

.meridesk-btn-block {
    width: 100%;
}

.meridesk-btn svg {
    width: 18px;
    height: 18px;
}

.meridesk-form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--meridesk-border);
    border-radius: var(--meridesk-radius);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.meridesk-form-control:focus {
    outline: none;
    border-color: var(--meridesk-primary);
}

.meridesk-form-group {
    margin-bottom: 20px;
}

.meridesk-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--meridesk-text);
}

.meridesk-required {
    color: var(--meridesk-error);
}

.meridesk-optional {
    color: var(--meridesk-text-light);
    font-weight: 400;
}

.meridesk-form-help {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--meridesk-text-light);
}

.meridesk-alert {
    padding: 12px 16px;
    border-radius: var(--meridesk-radius);
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
}

.meridesk-alert svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.meridesk-alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.meridesk-alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.meridesk-alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.meridesk-alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.meridesk-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--meridesk-text-light);
}

.meridesk-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: meridesk-spin 0.6s linear infinite;
}

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

.meridesk-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.meridesk-empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--meridesk-text-light);
    margin-bottom: 16px;
}

.meridesk-empty-state h3 {
    margin: 0 0 8px;
    font-size: 18px;
    color: var(--meridesk-text);
}

.meridesk-empty-state p {
    margin: 0 0 24px;
    color: var(--meridesk-text-light);
}

/* ===========================
   MODAL
   =========================== */

.meridesk-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999998;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: meridesk-fade-in 0.2s ease;
}

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

.meridesk-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.meridesk-modal-content {
    position: relative;
    background: white;
    border-radius: var(--meridesk-radius-lg);
    max-width: 500px;
    width: calc(100% - 40px);
    max-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: meridesk-modal-up 0.3s ease;
}

.meridesk-modal-large {
    max-width: 800px;
}

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

.meridesk-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--meridesk-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.meridesk-modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--meridesk-text);
}

.meridesk-modal-header p {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--meridesk-text-light);
}

.meridesk-modal-close {
    background: none;
    border: none;
    color: var(--meridesk-text-light);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.meridesk-modal-close:hover {
    background: var(--meridesk-bg-light);
    color: var(--meridesk-text);
}

.meridesk-modal-close svg {
    width: 20px;
    height: 20px;
}

.meridesk-modal-body {
    padding: 24px;
    overflow-y: auto;
}

/* ===========================
   PAGE LAYOUTS
   =========================== */

.meridesk-page-header {
    text-align: center;
    padding: 40px 20px;
    background: var(--meridesk-bg-light);
    border-bottom: 1px solid var(--meridesk-border);
}

.meridesk-page-header h1 {
    margin: 0 0 8px;
    font-size: 32px;
    color: var(--meridesk-text);
}

.meridesk-page-header p {
    margin: 0;
    font-size: 16px;
    color: var(--meridesk-text-light);
}

.meridesk-content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
}

.meridesk-main-content {
    min-width: 0;
}

.meridesk-sidebar {
    min-width: 0;
}

.meridesk-sidebar-box {
    background: white;
    border: 1px solid var(--meridesk-border);
    border-radius: var(--meridesk-radius);
    padding: 20px;
    margin-bottom: 20px;
}

.meridesk-sidebar-box h3 {
    margin: 0 0 12px;
    font-size: 16px;
}

.meridesk-sidebar-box p {
    margin: 0 0 16px;
    font-size: 14px;
    color: var(--meridesk-text-light);
}

/* ===========================
   SUPPORT CENTER
   =========================== */

.meridesk-hero {
    background: linear-gradient(135deg, var(--meridesk-primary) 0%, #6366f1 100%);
    color: white;
    padding: 60px 20px;
    text-align: center;
}

.meridesk-hero-content h1 {
    margin: 0 0 12px;
    font-size: 36px;
}

.meridesk-hero-content p {
    margin: 0 0 32px;
    font-size: 18px;
    opacity: 0.9;
}

.meridesk-hero-search {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.meridesk-hero-search-input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    border: none;
    border-radius: var(--meridesk-radius);
    font-size: 16px;
    box-shadow: var(--meridesk-shadow-lg);
}

.meridesk-hero-search .meridesk-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--meridesk-text-light);
}

.meridesk-quick-actions {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.meridesk-action-card {
    background: white;
    border: 1px solid var(--meridesk-border);
    border-radius: var(--meridesk-radius);
    padding: 24px;
    text-align: center;
    text-decoration: none;
    color: var(--meridesk-text);
    transition: all 0.2s;
    cursor: pointer;
}

.meridesk-action-card:hover {
    box-shadow: var(--meridesk-shadow-lg);
    transform: translateY(-4px);
}

.meridesk-action-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.meridesk-action-icon svg {
    width: 32px;
    height: 32px;
    color: var(--meridesk-primary);
}

.meridesk-action-card h3 {
    margin: 0 0 8px;
    font-size: 18px;
}

.meridesk-action-card p {
    margin: 0;
    font-size: 14px;
    color: var(--meridesk-text-light);
}

.meridesk-popular-articles,
.meridesk-stats {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.meridesk-popular-articles h2 {
    margin: 0 0 24px;
    font-size: 24px;
}

.meridesk-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
}

.meridesk-stat-card {
    background: white;
    border: 1px solid var(--meridesk-border);
    border-radius: var(--meridesk-radius);
    padding: 24px;
    text-align: center;
}

.meridesk-stat-number {
    font-size: 36px;
    font-weight: 700;
    color: var(--meridesk-primary);
    margin-bottom: 8px;
}

.meridesk-stat-label {
    font-size: 14px;
    color: var(--meridesk-text-light);
}

/* ===========================
   ARTICLES PAGE
   =========================== */

.meridesk-articles-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

.meridesk-articles-header {
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(135deg, var(--meridesk-primary) 0%, #6366f1 100%);
    color: white;
}

.meridesk-articles-header h1 {
    margin: 0 0 12px;
    font-size: 36px;
}

.meridesk-articles-header p {
    margin: 0 0 32px;
    font-size: 18px;
}

.meridesk-search-box {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.meridesk-search-input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    border: none;
    border-radius: var(--meridesk-radius);
    font-size: 16px;
    box-shadow: var(--meridesk-shadow-lg);
}

.meridesk-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--meridesk-text-light);
}

.meridesk-articles-layout {
    max-width: 1600px;
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 60px;
}

.meridesk-articles-sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.meridesk-categories-list {
    background: white;
    border: 1px solid var(--meridesk-border);
    border-radius: var(--meridesk-radius);
    padding: 12px;
}

.meridesk-category-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 4px;
    border: none;
    background: none;
    text-align: left;
    border-radius: var(--meridesk-radius);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: var(--meridesk-text);
}

.meridesk-category-item:hover,
.meridesk-category-item.active {
    background: var(--meridesk-bg-light);
    color: var(--meridesk-primary);
}

.meridesk-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.meridesk-article-card,
.meridesk-popular-article-card {
    background: white;
    border: 1px solid var(--meridesk-border);
    border-radius: var(--meridesk-radius);
    padding: 20px;
    cursor: pointer;
    text-decoration: none;
    color: var(--meridesk-text);
    transition: all 0.2s;
}

.meridesk-article-card:hover,
.meridesk-popular-article-card:hover {
    box-shadow: var(--meridesk-shadow-lg);
    transform: translateY(-2px);
}

.meridesk-article-card h3,
.meridesk-popular-article-card h3 {
    margin: 0 0 8px;
    font-size: 16px;
    color: var(--meridesk-text);
}

.meridesk-article-card p,
.meridesk-popular-article-card p {
    margin: 0;
    font-size: 14px;
    color: var(--meridesk-text-light);
    line-height: 1.5;
}

.meridesk-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--meridesk-bg-light);
    border: 1px solid var(--meridesk-border);
    border-radius: var(--meridesk-radius);
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 24px;
    transition: background 0.2s;
}

.meridesk-back-btn:hover {
    background: #e2e8f0;
}

.meridesk-back-btn svg {
    width: 18px;
    height: 18px;
}

.meridesk-article-content {
    background: white;
    border: 1px solid var(--meridesk-border);
    border-radius: var(--meridesk-radius);
    padding: 50px 80px;
    max-width: 100%;
}

.meridesk-article-header h1 {
    margin: 0 0 12px;
    font-size: 32px;
}

.meridesk-article-header p {
    margin: 0 0 16px;
    font-size: 18px;
    color: var(--meridesk-text-light);
}

.meridesk-article-meta {
    font-size: 14px;
    color: var(--meridesk-text-light);
}

.meridesk-article-toc {
    background: var(--meridesk-bg-light);
    border: 1px solid var(--meridesk-border);
    border-radius: var(--meridesk-radius);
    padding: 20px;
    margin: 24px 0;
}

.meridesk-article-toc h3 {
    margin: 0 0 12px;
    font-size: 16px;
}

.meridesk-article-toc ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.meridesk-article-toc li {
    margin-bottom: 8px;
}

.meridesk-article-toc a {
    color: var(--meridesk-primary);
    text-decoration: none;
    font-size: 14px;
}

.meridesk-article-toc a:hover {
    text-decoration: underline;
}

.meridesk-article-topic {
    margin-bottom: 40px;
}

.meridesk-article-topic h2 {
    margin: 0 0 16px;
    font-size: 24px;
    color: var(--meridesk-text);
}

.meridesk-article-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--meridesk-radius);
    margin: 16px 0;
    cursor: pointer;
    transition: transform 0.2s;
}

.meridesk-article-image:hover {
    transform: scale(1.02);
}

.meridesk-article-footer {
    border-top: 1px solid var(--meridesk-border);
    padding-top: 32px;
    margin-top: 40px;
}

.meridesk-article-feedback {
    text-align: center;
    margin-bottom: 32px;
}

.meridesk-article-feedback p {
    margin: 0 0 12px;
    font-size: 16px;
    color: var(--meridesk-text);
}

.meridesk-feedback-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.meridesk-feedback-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    border: 1px solid var(--meridesk-border);
    border-radius: var(--meridesk-radius);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.meridesk-feedback-btn:hover {
    background: var(--meridesk-bg-light);
}

.meridesk-feedback-btn svg {
    width: 18px;
    height: 18px;
}

.meridesk-article-actions {
    text-align: center;
}

.meridesk-article-actions p {
    margin: 0 0 12px;
    font-size: 16px;
    color: var(--meridesk-text);
}

/* ===========================
   TICKETS PAGE
   =========================== */

.meridesk-tickets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.meridesk-tickets-header h1 {
    margin: 0;
    font-size: 28px;
}

.meridesk-tickets-header p {
    margin: 4px 0 0;
    color: var(--meridesk-text-light);
}

.meridesk-tickets-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.meridesk-filter-btn {
    padding: 8px 16px;
    background: white;
    border: 1px solid var(--meridesk-border);
    border-radius: var(--meridesk-radius);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.meridesk-filter-btn:hover,
.meridesk-filter-btn.meridesk-filter-active {
    background: var(--meridesk-primary);
    color: white;
    border-color: var(--meridesk-primary);
}

.meridesk-tickets-search {
    position: relative;
    margin-bottom: 24px;
}

.meridesk-tickets-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.meridesk-ticket-item {
    background: white;
    border: 1px solid var(--meridesk-border);
    border-radius: var(--meridesk-radius);
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.meridesk-ticket-item:hover {
    box-shadow: var(--meridesk-shadow-lg);
    transform: translateX(4px);
}

.meridesk-ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.meridesk-ticket-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--meridesk-text);
}

.meridesk-ticket-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
}

.meridesk-status-pending {
    background: #fef3c7;
    color: #92400e;
}

.meridesk-status-open {
    background: #dbeafe;
    color: #1e40af;
}

.meridesk-status-resolved {
    background: #d1fae5;
    color: #065f46;
}

.meridesk-status-closed {
    background: #f3f4f6;
    color: #374151;
}

.meridesk-ticket-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--meridesk-text-light);
    margin-bottom: 12px;
}

.meridesk-ticket-item p {
    margin: 0;
    font-size: 14px;
    color: var(--meridesk-text);
    line-height: 1.5;
}

.meridesk-ticket-messages-container {
    display: flex;
    flex-direction: column;
    height: 500px;
}

.meridesk-messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--meridesk-bg-light);
}

.meridesk-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--meridesk-text-light);
    font-size: 14px;
}

.meridesk-error {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--meridesk-error);
    font-size: 14px;
    text-align: center;
}

.meridesk-message {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.meridesk-message-customer {
    align-items: flex-end;
}

.meridesk-message-agent {
    align-items: flex-start;
}

.meridesk-message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: var(--meridesk-radius);
    font-size: 14px;
    line-height: 1.5;
}

.meridesk-message-customer .meridesk-message-content {
    background: var(--meridesk-primary);
    color: white;
}

.meridesk-message-agent .meridesk-message-content {
    background: white;
    color: var(--meridesk-text);
    box-shadow: var(--meridesk-shadow);
}

.meridesk-message-time {
    font-size: 11px;
    color: var(--meridesk-text-light);
    margin-top: 4px;
    padding: 0 4px;
}

.meridesk-message-input-container {
    border-top: 1px solid var(--meridesk-border);
    background: white;
    padding: 16px;
}

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

.meridesk-message-input {
    flex: 1;
    border: 1px solid var(--meridesk-border);
    border-radius: var(--meridesk-radius);
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 100px;
}

.meridesk-message-input:focus {
    outline: none;
    border-color: var(--meridesk-primary);
}

.meridesk-message-send-btn {
    width: 40px;
    height: 40px;
    background: var(--meridesk-primary);
    color: white;
    border: none;
    border-radius: var(--meridesk-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.meridesk-message-send-btn:hover {
    background: var(--meridesk-primary-hover);
}

.meridesk-message-send-btn svg {
    width: 20px;
    height: 20px;
}

.meridesk-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--meridesk-bg-light);
    border: 1px solid var(--meridesk-border);
    border-radius: var(--meridesk-radius);
    margin-bottom: 20px;
}

.meridesk-user-avatar img {
    border-radius: 50%;
}

.meridesk-user-details {
    display: flex;
    flex-direction: column;
}

.meridesk-user-details strong {
    font-size: 14px;
    color: var(--meridesk-text);
}

.meridesk-user-details span {
    font-size: 13px;
    color: var(--meridesk-text-light);
}

/* ===========================
   VOICE CALL BUTTON & MODAL
   =========================== */

.meridesk-voice-btn {
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
    margin-right: 8px;
}

.meridesk-voice-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.meridesk-voice-btn .meridesk-call-icon,
.meridesk-voice-btn i {
    width: 20px;
    height: 20px;
}

.meridesk-call-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.meridesk-call-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.meridesk-call-modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    height: 90vh;
    max-height: 800px;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    animation: meridesk-modal-slide-up 0.3s ease-out;
}

@keyframes meridesk-modal-slide-up {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.meridesk-call-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.meridesk-call-modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.meridesk-call-modal-close i {
    width: 20px;
    height: 20px;
}

.meridesk-call-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Loading state for iframe */
.meridesk-call-modal-content.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--meridesk-primary);
    border-radius: 50%;
    animation: meridesk-spin 1s linear infinite;
    z-index: 1;
}

@keyframes meridesk-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

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

@media (max-width: 768px) {
    .meridesk-content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .meridesk-chat-popup {
        width: calc(100vw - 40px);
        height: calc(100vh - 120px);
    }
    
    .meridesk-hero-content h1 {
        font-size: 28px;
    }
    
    .meridesk-quick-actions {
        grid-template-columns: 1fr;
    }
    
    .meridesk-articles-layout {
        grid-template-columns: 1fr;
    }
    
    .meridesk-articles-sidebar {
        position: static;
    }
    
    .meridesk-article-content {
        padding: 30px 20px;
    }
    
    .meridesk-tickets-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .meridesk-modal-content {
        max-width: calc(100% - 20px);
    }
    
    .meridesk-ticket-messages-container {
        height: 400px;
    }
    
    .meridesk-call-modal-content {
        width: 100%;
        height: 100%;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    .meridesk-call-modal-close {
        top: 12px;
        right: 12px;
    }
}

