@charset "UTF-8";
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Tomorrow:wght@600;700&family=Outfit:wght@400;600;700&display=swap');

/* ==========================================================
   SH-Ticket — Version 10: PREMIUM SYNTHESIS
   ========================================================== */
:root {
    --sht-primary:       #0f172a;
    --sht-accent:        #316c27;
    --sht-accent-hover:  #24521d;
    --sht-accent-rgb:    49, 108, 39;
    
    /* Semantic Colors */
    --sht-success:  #10b981;
    --sht-warning:  #f59e0b;
    --sht-danger:   #ef4444;
    --sht-info:     #0ea5e9;

    /* Surfaces */
    --sht-bg:           #ffffff;
    --sht-surface:      #f8fafc;
    --sht-border:       #ccd6e0;
    --sht-border-light: #f1f5f9;
    
    /* Text */
    --sht-text-main:    #334155;
    --sht-text-muted:   #64748b;
    --sht-text-light:   #94a3b8;

    /* Geometry */
    --sht-radius-xl:  24px;
    --sht-radius-lg:  16px;
    --sht-radius-md:  12px;
    --sht-radius-sm:  8px;
    
    /* Shadows */
    --sht-shadow-sm:     0 1px 3px rgba(0,0,0,0.05);
    --sht-shadow-md:     0 4px 12px rgba(0,0,0,0.04);
    --sht-shadow-lg:     0 10px 30px -5px rgba(0,0,0,0.05);
    --sht-shadow-bubble: 0 4px 15px rgba(0,0,0,0.02);
}

.sh-ticket-wrapper {
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--sht-text-main);
    background-color: var(--sht-bg);
    line-height: 1.6;
    padding: 30px 0;
    min-height: 100vh;
}

/* ==========================================================
   Typography
   ========================================================== */
.sh-ticket-wrapper h1, .sh-ticket-wrapper h2, .sh-ticket-wrapper h3, .sh-ticket-wrapper h4 { 
    font-family: 'Tomorrow', sans-serif !important; 
    letter-spacing: -0.02em;
}

.sh-ticket-wrapper h3 { 
    font-size: 1.25rem; 
    font-weight: 700; 
    color: var(--sht-primary); 
}

.sh-ticket-wrapper .container {
    max-width: 980px;
}

/* ==========================================================
   LIVE CHAT GROUPING & ANIMATIONS
   ========================================================== */
@keyframes shtFadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.sh-ticket-wrapper .sh-ticket-conversation {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    padding: 1.5rem 0 !important;
}

/* Base Message Row */
.sh-ticket-wrapper .sh-ticket-message-item {
    display: flex !important;
    flex-wrap: nowrap !important;
    width: 100% !important;
    gap: 12px !important;
    align-items: flex-end !important;
    position: relative !important;
    padding-top: 16px !important;
    animation: shtFadeUp 0.4s ease forwards;
}

/* Directional Locking */
.sh-ticket-wrapper .sh-ticket-message-item.is-staff {
    flex-direction: row !important;
    justify-content: flex-start !important;
}

.sh-ticket-wrapper .sh-ticket-message-item.is-self {
    flex-direction: row-reverse !important;
    justify-content: flex-start !important;
}

/* Consecutive Spacing */
.sh-ticket-wrapper .sh-ticket-message-item.is-consecutive {
    padding-top: 2px !important;
}

/* Live Chat Avatars */
.sh-ticket-wrapper .msg-avatar {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    border: 2px solid white !important;
    background: #f1f5f9 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 2;
}

.sh-ticket-wrapper .msg-avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.sh-ticket-wrapper .msg-avatar span {
    font-size: 0.8rem !important;
    font-weight: 800 !important;
    color: #1e293b !important;
    font-family: 'Tomorrow', sans-serif;
    letter-spacing: -0.02em;
}

.sh-ticket-wrapper .msg-avatar-placeholder {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    pointer-events: none;
}

/* Live Chat Bubbles */
.sh-ticket-wrapper .msg-bubble-wrap {
    max-width: 65% !important;
    width: auto !important;
    display: flex !important;
    flex-direction: column !important;
}

.sh-ticket-wrapper .is-staff .msg-bubble-wrap { align-items: flex-start !important; }
.sh-ticket-wrapper .is-self .msg-bubble-wrap { align-items: flex-end !important; }

.sh-ticket-wrapper .message-bubble {
    padding: 12px 18px !important;
    border-radius: var(--sht-radius-md) !important;
    font-size: 0.925rem !important;
    position: relative !important;
    line-height: 1.55 !important;
    width: fit-content !important;
    max-width: 100% !important;
    word-break: break-word !important;
    box-shadow: var(--sht-shadow-bubble) !important;
    transition: transform 0.2s ease;
}

.sh-ticket-wrapper .message-bubble:hover {
    transform: scale(1.005);
}

/* Staff Bubble (Left) */
.sh-ticket-wrapper .is-staff .message-bubble {
    background: white !important;
    border: 1px solid var(--sht-border-light) !important;
    border-bottom-left-radius: 4px !important;
    color: var(--sht-text-main) !important;
}

/* User Bubble (Right) */
.sh-ticket-wrapper .is-self .message-bubble {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    color: white !important;
    border: 1px solid rgba(255,255,255,0.05) !important;
    border-bottom-right-radius: 4px !important;
    box-shadow: 0 10px 25px -8px rgba(15, 23, 42, 0.4) !important;
}

/* Metadata */
.sh-ticket-wrapper .message-bubble-header {
    font-size: 0.65rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    margin-bottom: 6px !important;
    color: var(--sht-text-muted) !important;
    font-family: 'Outfit', sans-serif;
    display: flex !important;
    align-items: center !important;
}

.sh-ticket-wrapper .is-self .message-bubble-header { justify-content: flex-end; }

.sh-ticket-wrapper .message-sent-time {
    font-size: 0.6rem !important;
    color: var(--sht-text-light) !important;
    margin-top: 5px !important;
    font-weight: 600 !important;
    font-family: 'Outfit', sans-serif;
}

/* ==========================================================
   COMPONENTS & WIDGETS
   ========================================================== */
.sh-ticket-wrapper .sh-ticket-card {
    background: white;
    border: 1px solid var(--sht-border-light);
    border-radius: var(--sht-radius-lg);
    padding: 1.25rem;
    box-shadow: var(--sht-shadow-lg);
}

/* Context/Pin Card Refinement */
.sh-ticket-wrapper .sh-ticket-card-context {
    background: #f8fafc !important;
    border: 1px dashed var(--sht-border) !important;
    border-radius: var(--sht-radius-md) !important;
}

.sh-ticket-wrapper .context-content {
    background: white !important;
    border: 1px solid var(--sht-border-light) !important;
    padding: 1rem !important;
    border-radius: var(--sht-radius-sm) !important;
    font-size: 0.875rem !important;
    color: var(--sht-text-main) !important;
    box-shadow: var(--sht-shadow-sm) !important;
}

/* Live Reply Input */
.sh-ticket-wrapper .btn-primary {
    background: linear-gradient(135deg, #0f172a 0%, #334155 100%) !important;
    border-radius: var(--sht-radius-md) !important;
    padding: 0.85rem 2rem !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    font-family: 'Outfit', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border: none !important;
    box-shadow: 0 10px 20px -5px rgba(15, 23, 42, 0.3) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 50px;
}

.sh-ticket-wrapper .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px -8px rgba(15, 23, 42, 0.4) !important;
    filter: brightness(1.15);
}

.sh-ticket-wrapper .btn-primary:active {
    transform: translateY(-1px);
}

/* Form Elements Outline */
.sh-ticket-wrapper .form-control,
.sh-ticket-wrapper .form-select,
.sh-ticket-wrapper input[type="text"],
.sh-ticket-wrapper input[type="email"],
.sh-ticket-wrapper input[type="url"],
.sh-ticket-wrapper input[type="password"],
.sh-ticket-wrapper input[type="number"],
.sh-ticket-wrapper input[type="tel"],
.sh-ticket-wrapper textarea,
.sh-ticket-wrapper select {
    border: 1.5px solid var(--sht-border) !important;
    border-radius: var(--sht-radius-md) !important;
    padding: 0.85rem 1.25rem !important;
    font-size: 0.95rem !important;
    background-color: #fff !important;
    box-shadow: none !important;
    transition: all 0.2s ease-in-out !important;
    color: var(--sht-text-main) !important;
    height: auto !important;
}

.sh-ticket-wrapper .form-control::placeholder,
.sh-ticket-wrapper input::placeholder,
.sh-ticket-wrapper textarea::placeholder {
    color: var(--sht-text-light) !important;
    opacity: 0.7;
}

.sh-ticket-wrapper .form-control:hover,
.sh-ticket-wrapper .form-select:hover,
.sh-ticket-wrapper input:hover,
.sh-ticket-wrapper textarea:hover,
.sh-ticket-wrapper select:hover {
    border-color: var(--sht-text-light) !important;
}

.sh-ticket-wrapper .form-control:focus,
.sh-ticket-wrapper .form-select:focus,
.sh-ticket-wrapper input:focus,
.sh-ticket-wrapper textarea:focus,
.sh-ticket-wrapper select:focus {
    border-color: var(--sht-accent) !important;
    box-shadow: 0 0 0 4px rgba(var(--sht-accent-rgb), 0.1) !important;
    outline: none !important;
    background-color: #fff !important;
}

/* TinyMCE Skinning & Outline */
.sh-ticket-wrapper .sht-tinymce-container {
    border: 1.5px solid var(--sht-border) !important;
    background: white !important;
    margin-bottom: 12px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.3s ease;
    border-radius: var(--sht-radius-md) !important;
}

.sh-ticket-wrapper .sht-tinymce-container:focus-within {
    border-color: var(--sht-primary) !important;
    box-shadow: 0 0 0 4px rgba(15, 23, 42, 0.05) !important;
}

/* Responsive */
@media (max-width: 992px) {
    .sh-ticket-wrapper .msg-bubble-wrap { max-width: 85%; }
}

@media (max-width: 768px) {
    .sh-ticket-wrapper .container { padding: 0 15px; }
    .sh-ticket-wrapper .msg-bubble-wrap { max-width: 90%; }
}
/* ==========================================================
   STAT CARDS (PREMIUM)
   ========================================================== */
.sh-ticket-stats {
    background: white;
    border: 1px solid var(--sht-border-light);
    border-radius: var(--sht-radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    box-shadow: var(--sht-shadow-sm);
    height: 100%;
}

.sh-ticket-stats:hover {
    transform: translateY(-5px);
    box-shadow: var(--sht-shadow-lg);
    border-color: var(--sht-accent);
}

.sh-ticket-stats::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--stat-brand-color, var(--sht-primary));
    opacity: 0.8;
}

.sh-ticket-stat-icon {
    width: 60px;
    height: 60px;
    background: var(--stat-bg-color, #f1f5f9);
    border-radius: var(--sht-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--stat-brand-color, var(--sht-primary));
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.sh-ticket-stats:hover .sh-ticket-stat-icon {
    transform: scale(1.1) rotate(5deg);
    background: var(--stat-brand-color);
    color: white;
}

.sh-ticket-stat-content {
    display: flex;
    flex-direction: column;
}

.sh-ticket-stat-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 800;
    color: var(--sht-text-muted);
    font-family: 'Outfit', sans-serif;
    margin-bottom: 2px;
}

.sh-ticket-stat-count {
    font-size: 2.25rem;
    line-height: 1;
    font-weight: 800;
    font-family: 'Tomorrow', sans-serif;
    color: var(--sht-primary);
    margin: 0;
}

/* Color Contexts */
.sh-ticket-stats[data-color="primary"] { --stat-brand-color: var(--sht-info); --stat-bg-color: #f0f9ff; }
.sh-ticket-stats[data-color="success"] { --stat-brand-color: var(--sht-success); --stat-bg-color: #ecfdf5; }
.sh-ticket-stats[data-color="warning"] { --stat-brand-color: var(--sht-warning); --stat-bg-color: #fffbeb; }
.sh-ticket-stats[data-color="danger"]  { --stat-brand-color: var(--sht-danger); --stat-bg-color: #fef2f2; }

@media (max-width: 576px) {
    .sh-ticket-stats {
        padding: 1.25rem;
    }
    .sh-ticket-stat-count {
        font-size: 1.75rem;
    }
}
