/* PREMIUM DARK ADMIN PANEL */

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: #0a0a0a;
    color: #ffffff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Panel moderatora - bez scrollowania */
body.moderator-panel {
    overflow: hidden;
}

/* Strona statystyk - ze scrollowaniem */
body.statistics-page {
    overflow-y: auto;
    min-height: 100vh;
}

.full-height {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 24px;
    box-sizing: border-box;
    max-width: 95vw;
    margin: 0 auto;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
}

.container {
    height: 100%;
    display: flex;
    flex-direction: column;
    max-width: 100vw!important;
    /* Usunięto padding-top: 0; aby nie nadpisywać .full-height */
}


/* HEADER STYLES */
.mb-1 {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mb-1 h1 {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.5px;
    margin: 0;
}

.mb-1 .flex {
    align-items: center;
}

.mb-1 button, .mb-1 a {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.mb-1 button:hover, .mb-1 a:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Header Buttons */
.header-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    text-decoration: none;
    cursor: pointer;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.header-btn .btn-icon {
    font-size: 16px;
    line-height: 1;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.header-btn:active {
    transform: translateY(0);
}

.header-btn-logout {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.header-btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ffffff;
}

/* CONTAINER STYLES */
.chat-container, .conversation-list-container, .quick-replies-container {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 8px;
    backdrop-filter: blur(40px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* ========================================
   COMPACT CHAT HEADER - Modal Style
   ======================================== */

.chat-header-compact {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
    backdrop-filter: blur(20px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chat-header-compact .flex {
    align-items: center;
    margin-bottom: 6px;
}

.customer-name-compact {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: -0.3px;
    line-height: 1.2;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.customer-id-compact {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
    line-height: 1.2;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
}

.customer-info-compact {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    margin: 0 0 8px 0;
    line-height: 1.3;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Compact Info Row - Tags and Reminders */
.compact-info-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    flex-wrap: wrap;
    min-height: 24px;
}

/* Tags Styling */
.tags-compact {
    flex: 1;
    min-width: 0;
}

.tags-compact #client-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.tags-compact .client-tags-list span,
.tags-compact #client-tags-list span,
.tags-compact #client-tags-list button,
.tags-compact #client-tags-list .tag-item {
    font-size: 11px;
    padding: 3px 8px;
    margin: 0;
    line-height: 1.3;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.tags-compact #client-tags-list .btn-add-tag-inline {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tags-compact #client-tags-list .btn-add-tag-inline:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.tags-compact #client-tags-list .tag-item {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #3b82f6;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.tags-compact #client-tags-list .tag-item:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.4);
}

.tags-compact #client-tags-list .btn-delete-tag-inline {
    color: rgba(239, 68, 68, 0.7);
    font-weight: 600;
    cursor: pointer;
    padding: 0 2px;
    transition: all 0.2s ease;
}

.tags-compact #client-tags-list .btn-delete-tag-inline:hover {
    color: #ef4444;
    transform: scale(1.2);
}

/* Reminders Styling - Modern Design */
.reminders-compact {
    flex-shrink: 0;
    background: rgba(255, 149, 0, 0.1);
    border: 1px solid rgba(255, 149, 0, 0.3);
    border-radius: 8px;
    padding: 6px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 200px;
    max-width: 400px;
    box-shadow: 0 2px 6px rgba(255, 149, 0, 0.1);
    transition: all 0.2s ease;
}

.reminders-compact:hover {
    background: rgba(255, 149, 0, 0.15);
    border-color: rgba(255, 149, 0, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.15);
}

.reminders-compact-label {
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 149, 0, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.reminders-compact-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.reminder-item-compact {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.4;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border: 1px solid rgba(255, 149, 0, 0.2);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    transition: all 0.2s ease;
}

.reminder-item-compact:hover {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 149, 0, 0.3);
}

.reminder-item-compact strong {
    color: #ffffff;
    font-weight: 600;
}

/* Inline tag add form styling */
.inline-add-form {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.inline-add-form #inline-tag-input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.inline-add-form #inline-tag-input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.1);
}

.inline-add-form #btn-confirm-add-tag {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #10b981;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.inline-add-form #btn-confirm-add-tag:hover {
    background: rgba(16, 185, 129, 0.3);
    transform: scale(1.05);
}

.inline-add-form #btn-cancel-add-tag {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #ef4444;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.inline-add-form #btn-cancel-add-tag:hover {
    background: rgba(239, 68, 68, 0.3);
    transform: scale(1.05);
}

/* Responsive adjustments for chat header */
@media (max-width: 768px) {
    .chat-header-compact {
        padding: 10px 12px;
    }
    
    .customer-name-compact {
        font-size: 16px;
    }
    
    .customer-id-compact {
        font-size: 12px;
    }
    
    .customer-info-compact {
        font-size: 10px;
    }
    
    .compact-info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .reminders-compact {
        width: 100%;
        max-width: none;
    }
}

.conversation-list-container h3, .quick-replies-container h3 {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 20px;
    letter-spacing: -0.3px;
}

/* LICZNIKI NIEPRZECZYTANYCH WIADOMOŚCI */
.waiting-counter {
    color: #FF9500;
    font-weight: 700;
    font-size: 16px;
    animation: pulse-counter 2s infinite;
}

@keyframes pulse-counter {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.unread-badge {
    background: linear-gradient(135deg, #FF3B30 0%, #D70015 100%);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    border: 1px solid rgba(255, 59, 48, 0.3);
    box-shadow: 0 2px 8px rgba(255, 59, 48, 0.3);
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    animation: pulse-badge 1.5s infinite;
}

@keyframes pulse-badge {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(255, 59, 48, 0.3);
    }
    50% { 
        transform: scale(1.1);
        box-shadow: 0 4px 12px rgba(255, 59, 48, 0.5);
    }
}

.unread-badge.single {
    background: linear-gradient(135deg, #FF9500 0%, #FF6B00 100%);
    border-color: rgba(255, 149, 0, 0.3);
    box-shadow: 0 2px 8px rgba(255, 149, 0, 0.3);
}

@keyframes pulse-badge-single {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(255, 149, 0, 0.3);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(255, 149, 0, 0.4);
    }
}

.unread-badge.single {
    animation: pulse-badge-single 2s infinite;
}

/* QUICK REPLIES CONTAINER */
.quick-replies-container {
    min-width: 280px;
}

#quick-replies-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#quick-replies-list::-webkit-scrollbar {
    display: none;
}

.quick-reply-button {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 12px;
    margin-bottom: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    backdrop-filter: blur(20px);
    text-align: left;
    width: 100%;
    font-size: 13px;
    line-height: 1.4;
    position: relative;
    display: block;
}

.quick-reply-button:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.quick-reply-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.quick-reply-key {
    font-size: 11px;
    color: #007AFF;
    font-weight: 600;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    margin-bottom: 4px;
    display: block;
}

.quick-reply-preview {
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quick-reply-reminder {
    font-size: 11px;
    color: #3b82f6;
    margin-top: 2px;
    font-style: italic;
}


#quick-reply-search {
    font-size: 14px !important;
    padding: 10px 14px !important;
}

/* CHAT BODY */
.chat-body {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 12px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.chat-body::-webkit-scrollbar {
    display: none;
}

/* MESSAGES */
.message {
    margin-bottom: 8px;
    padding: 8px 12px;
    border-radius: 12px;
    max-width: 85%;
    position: relative;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 400;
    backdrop-filter: blur(20px);
}

.message-client {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.04) 100%);
    align-self: flex-start;
    margin-right: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.message-moderator {
    background: linear-gradient(135deg, #007AFF 0%, #0056CC 100%);
    align-self: flex-end;
    margin-left: auto;
    color: #ffffff;
    border: 1px solid rgba(0, 122, 255, 0.3);
}

.message-user {
    font-weight: 600;
    font-size: 11px;
    margin-bottom: 4px;
    opacity: 0.8;
    text-transform: none;
    letter-spacing: 0;
}

.message-time {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
    text-align: right;
}

/* CONVERSATION LIST */
#conversation-list {
    flex: 1;
    overflow-y: auto;
    /* padding-right: 8px;*/
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#conversation-list::-webkit-scrollbar {
    display: none;
}

.conversation-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    padding: 16px;
    border-radius: 16px;
    margin-bottom: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    backdrop-filter: blur(20px);
}

.conversation-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.conversation-item.bg-blue-50 {
    background: linear-gradient(135deg, #007AFF 0%, #0056CC 100%) !important;
    border-color: rgba(0, 122, 255, 0.3) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 25px rgba(0, 122, 255, 0.2) !important;
}

.conversation-item.waiting-conversation {
    background: linear-gradient(135deg, #FF9500 0%, #FF6B00 100%) !important;
    border-color: rgba(255, 149, 0, 0.3) !important;
    color: #ffffff !important;
    animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
    0%, 100% { box-shadow: 0 8px 25px rgba(255, 149, 0, 0.2); }
    50% { box-shadow: 0 8px 25px rgba(255, 149, 0, 0.4); }
}

.conversation-item.error-conversation {
    background: linear-gradient(135deg, #FF3B30 0%, #D70015 100%) !important;
    border-color: rgba(255, 59, 48, 0.3) !important;
    color: #ffffff !important;
    animation: pulse-error 2s infinite;
}

@keyframes pulse-error {
    0%, 100% { box-shadow: 0 8px 25px rgba(255, 59, 48, 0.2); }
    50% { box-shadow: 0 8px 25px rgba(255, 59, 48, 0.4); }
}

.conversation-item strong {
    color: #ffffff;
    font-weight: 600;
}

.message-preview {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-size: 14px;
    line-height: 1.4;
    margin-top: 8px;
    margin-bottom: 4px;
    opacity: 0.8;
}

.message-preview-client {
    font-weight: 500;
    color: #ffffff;
}

.message-preview-moderator {
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    font-style: normal;
}

/* FORM ELEMENTS */
input, select, textarea {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    backdrop-filter: blur(20px) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

input:focus, select:focus, textarea:focus {
    border-color: #007AFF !important;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1) !important;
    outline: none !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

input::placeholder, textarea::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

/* SEARCH BAR */
.mb-3 input {
    font-size: 14px !important;
    padding: 10px 14px !important;
}

/* BUTTONS */
button {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
}

button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* SPECIFIC BUTTON STYLES */
#btn-send-reply {
    background: linear-gradient(135deg, #007AFF 0%, #0056CC 100%) !important;
    border-color: rgba(0, 122, 255, 0.3) !important;
    color: #ffffff !important;
}

#btn-send-reply:hover {
    background: linear-gradient(135deg, #0056CC 0%, #003D99 100%) !important;
    box-shadow: 0 8px 25px rgba(0, 122, 255, 0.3) !important;
}

#btn-ai-helper {
    background: linear-gradient(135deg, #AF52DE 0%, #8E44AD 100%) !important;
    border-color: rgba(175, 82, 222, 0.3) !important;
    color: #ffffff !important;
}

#btn-ai-helper:hover {
    background: linear-gradient(135deg, #8E44AD 0%, #6C3483 100%) !important;
    box-shadow: 0 8px 25px rgba(175, 82, 222, 0.3) !important;
}

#btn-mark-as-read {
    background: linear-gradient(135deg, #34C759 0%, #28A745 100%) !important;
    border-color: rgba(52, 199, 89, 0.3) !important;
    color: #ffffff !important;
}

#btn-mark-as-read:hover {
    background: linear-gradient(135deg, #28A745 0%, #1E7E34 100%) !important;
    box-shadow: 0 8px 25px rgba(52, 199, 89, 0.3) !important;
}

#btn-schedule-reminder {
    background: linear-gradient(135deg, #FF9500 0%, #FF6B00 100%) !important;
    border-color: rgba(255, 149, 0, 0.3) !important;
    color: #ffffff !important;
}

#btn-schedule-reminder:hover {
    background: linear-gradient(135deg, #FF6B00 0%, #E55100 100%) !important;
    box-shadow: 0 8px 25px rgba(255, 149, 0, 0.3) !important;
}

/* SEARCH BUTTONS */
#btn-search {
    background: linear-gradient(135deg, #007AFF 0%, #0056CC 100%) !important;
    border-color: rgba(0, 122, 255, 0.3) !important;
    font-size: 12px !important;
    padding: 8px 16px !important;
}

#btn-reset-search {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    font-size: 12px !important;
    padding: 8px 16px !important;
}

#toggle-advanced-filter {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
    font-size: 12px !important;
    padding: 8px 16px !important;
}

/* COMPACT CHAT FOOTER */
.chat-footer {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-footer textarea {
    min-height: 45px;
    resize: none;
    font-size: 12px !important;
    line-height: 1.3 !important;
    padding: 6px 10px !important;
}

.compact-footer-row {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 28px;
}

.main-buttons {
    display: flex;
    gap: 4px;
    flex: 1;
}

.btn-compact {
    flex: 1;
    padding: 4px 8px;
    font-size: 20px;
    font-weight: 600;
    border-radius: 6px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    transition: all 0.15s ease;
}

.btn-send {
    background: linear-gradient(135deg, #007AFF 0%, #0056CC 100%) !important;
    border: 1px solid rgba(0, 122, 255, 0.3) !important;
    color: #ffffff !important;
}

.btn-send:hover {
    background: linear-gradient(135deg, #0056CC 0%, #003D99 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3) !important;
}

.btn-ai {
    background: linear-gradient(135deg, #AF52DE 0%, #8E44AD 100%) !important;
    border: 1px solid rgba(175, 82, 222, 0.3) !important;
    color: #ffffff !important;
}

.btn-ai:hover {
    background: linear-gradient(135deg, #8E44AD 0%, #6C3483 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(175, 82, 222, 0.3) !important;
}

.btn-read {
    background: linear-gradient(135deg, #34C759 0%, #28A745 100%) !important;
    border: 1px solid rgba(52, 199, 89, 0.3) !important;
    color: #ffffff !important;
}

.btn-read:hover {
    background: linear-gradient(135deg, #28A745 0%, #1E7E34 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.3) !important;
}

.reminder-inline {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
    min-width: 140px;
}

.reminder-select {
    flex: 1;
    height: 28px;
    font-size: 13px !important;
    padding: 4px 6px !important;
    border-radius: 4px !important;
    background: rgba(0, 0, 0, 0.8) !important;
    border: 1px solid rgba(255, 149, 0, 0.3) !important;
    color: #ffffff !important;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

.reminder-select:focus {
    border-color: #FF9500 !important;
    box-shadow: 0 0 0 2px rgba(255, 149, 0, 0.2) !important;
    background: rgba(0, 0, 0, 0.9) !important;
}

.reminder-select option {
    background: rgba(0, 0, 0, 0.95) !important;
    color: #ffffff !important;
    padding: 4px 6px !important;
    border: none !important;
}

.reminder-select option:hover {
    background: rgba(255, 149, 0, 0.2) !important;
}

.reminder-select option:checked {
    background: rgba(255, 149, 0, 0.3) !important;
}

.btn-reminder {
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    background: linear-gradient(135deg, #FF9500 0%, #FF6B00 100%) !important;
    border: 1px solid rgba(255, 149, 0, 0.3) !important;
    color: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    transition: all 0.15s ease;
}

.btn-reminder:hover {
    background: linear-gradient(135deg, #FF6B00 0%, #E55100 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.3) !important;
}

/* TAGS */
.client-tags-list span {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 1px 5px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    margin-right: 3px;
    margin-bottom: 1px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
}

/* ========================================
   UNIFIED MODAL SYSTEM
   ======================================== */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 9990;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.modal-overlay.hidden {
    display: none;
}

/* Modal Container Sizes */
.modal-container {
    position: relative;
    background: linear-gradient(135deg, #0d0d0d 0%, #1a1a1a 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    width: 100%;
    max-width: 600px;
    margin: 40px auto;
    animation: modalFadeIn 0.2s ease-out;
}

.modal-medium {
    max-width: 700px;
}

.modal-large {
    max-width: 900px;
}

.modal-xlarge {
    max-width: 1200px;
}

.modal-scrollable {
    max-height: calc(100vh - 80px);
    overflow-y: auto;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Header */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px 16px 0 0;
}

.modal-title {
    font-size: 22px;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: -0.5px;
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.modal-close-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 59, 48, 0.08);
    border: 1px solid rgba(255, 59, 48, 0.2);
    border-radius: 10px;
    color: #FF3B30;
    font-size: 24px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.modal-close-btn:hover {
    background: rgba(255, 59, 48, 0.15);
    border-color: rgba(255, 59, 48, 0.4);
    transform: scale(1.05);
}

.modal-close-btn:active {
    transform: scale(0.95);
}

/* Modal Body */
.modal-body {
    padding: 28px;
}

/* Modal Footer */
.modal-footer {
    padding: 20px 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 0 0 16px 16px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ========================================
   UNIFIED BUTTON SYSTEM
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    white-space: nowrap;
    user-select: none;
}

.btn-icon {
    font-size: 16px;
    line-height: 1;
}

/* Button Sizes */
.btn-small {
    padding: 8px 16px;
    font-size: 14px;
}

.btn-large {
    padding: 13px 28px;
    font-size: 16px;
}

/* Button Variants */
.btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: rgba(16, 185, 129, 0.3);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: rgba(59, 130, 246, 0.3);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: rgba(16, 185, 129, 0.3);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn:disabled {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ========================================
   FORM ELEMENTS
   ======================================== */

.modal-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 8px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.modal-hint {
    display: block;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 6px;
    line-height: 1.4;
}

.modal-input,
.modal-select,
.modal-textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 10px !important;
    color: #ffffff !important;
    font-size: 15px !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    transition: all 0.2s ease !important;
    padding: 11px 16px !important;
}

.modal-input:focus,
.modal-select:focus,
.modal-textarea:focus {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
    outline: none !important;
}

.modal-input::placeholder,
.modal-textarea::placeholder {
    color: rgba(255, 255, 255, 0.3) !important;
}

.modal-textarea {
    resize: vertical;
    min-height: 120px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace !important;
    line-height: 1.6 !important;
}

/* Select Dropdown Styling */
.modal-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px !important;
}

.modal-select option {
    background: #1a1a1a;
    color: #ffffff;
    padding: 8px;
}

/* ========================================
   SPECIALIZED COMPONENTS
   ======================================== */

/* Tag Container */
.tag-container {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 16px;
    max-height: 200px;
    overflow-y: auto;
}

/* Preview Box */
.preview-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 20px;
}

.preview-content {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    line-height: 1.6;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
}

/* Result Box */
.result-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 16px;
}

.result-label {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.result-content {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.6;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;
}

/* ========================================
   RESPONSIVE MODAL DESIGN
   ======================================== */

@media (max-width: 768px) {
    .modal-overlay {
        padding: 10px;
    }
    
    .modal-container {
        margin: 20px auto;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 20px;
    }
    
    .modal-title {
        font-size: 19px;
    }
    
    .modal-close-btn {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
    
    .btn {
        padding: 10px 18px;
        font-size: 14px;
    }
    
    .btn-large {
        padding: 11px 24px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .modal-container {
        margin: 10px auto;
        border-radius: 12px;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 16px;
    }
    
    .modal-title {
        font-size: 17px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    .btn {
        padding: 9px 16px;
        font-size: 14px;
        width: 100%;
    }
}

/* REMINDERS */
#active-reminders-container {
    background: rgba(255, 149, 0, 0.1);
    border: 1px solid rgba(255, 149, 0, 0.2);
    border-radius: 3px;
    padding: 1px 3px;
    backdrop-filter: blur(20px);
    font-size: 7px;
    margin-top: 0;
    margin-bottom: 0;
    line-height: 1;
}

/* QUICK REPLIES */
.quick-replies {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    backdrop-filter: blur(20px);
}

.quick-reply-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-radius: 8px;
    margin: 8px;
    padding: 12px 16px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.quick-reply-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.quick-reply-item.selected {
    background: linear-gradient(135deg, #007AFF 0%, #0056CC 100%) !important;
    border-color: rgba(0, 122, 255, 0.3) !important;
    color: #ffffff !important;
}

/* OPTIMISTIC MESSAGES */
.optimistic-message {
    opacity: 0.7;
    animation: pulse-sending 1.5s infinite;
}

@keyframes pulse-sending {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 0.9; }
}

/* MESSAGE ERRORS */
.message-error {
    border: 1px solid rgba(255, 59, 48, 0.3);
    background: linear-gradient(135deg, #FF3B30 0%, #D70015 100%);
}

.message-error-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .full-height {
        padding: 16px;
    }
    
    .chat-container, .conversation-list-container {
        padding: 16px;
        border-radius: 16px;
    }
    
    .fixed .relative {
        width: 90% !important;
        margin: 20px auto !important;
    }
    
    .button-row {
        flex-direction: column;
    }
    
    .button-row button {
        flex: none;
    }
}

/* MESSAGES AREA */
#messages-area {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 200px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
}

/* LOADING STATES */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ANIMATIONS */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.conversation-item.new-item, .message.new-message {
    animation: fadeIn 0.3s ease-out;
}

/* FOCUS STATES */
*:focus {
    outline: none;
}

/* SELECTION */
::selection {
    background: rgba(0, 122, 255, 0.3);
    color: #ffffff;
}

/* IMPROVED SELECTION FOR MODERATOR MESSAGES */
.message-moderator ::selection {
    background: rgba(255, 255, 255, 0.4);
    color: #000000;
}

.message-moderator .message-content ::selection {
    background: rgba(255, 255, 255, 0.4);
    color: #000000;
}

/* NOTIFICATION SYSTEM */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    pointer-events: none;
}

.notification {
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 12px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    max-width: 350px;
    word-wrap: break-word;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification.hide {
    transform: translateX(100%);
    opacity: 0;
}

.notification.success {
    border-color: rgba(52, 199, 89, 0.4);
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.2) 0%, rgba(40, 167, 69, 0.2) 100%);
}

.notification.error {
    border-color: rgba(255, 59, 48, 0.4);
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.2) 0%, rgba(215, 0, 21, 0.2) 100%);
}

.notification.warning {
    border-color: rgba(255, 149, 0, 0.4);
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.2) 0%, rgba(255, 107, 0, 0.2) 100%);
}

.notification.info {
    border-color: rgba(0, 122, 255, 0.4);
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.2) 0%, rgba(0, 86, 204, 0.2) 100%);
}

.notification-icon {
    display: inline-block;
    margin-right: 8px;
    font-size: 16px;
}

.notification-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.notification-close:hover {
    color: rgba(255, 255, 255, 0.9);
}

/* SCROLLBAR STYLING FOR WEBKIT */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* STATISTICS STYLES */
.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
    backdrop-filter: blur(40px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.stat-card-today {
    background: rgba(255, 193, 7, 0.05);
    border-color: rgba(255, 193, 7, 0.2);
}

.stat-card-today:hover {
    background: rgba(255, 193, 7, 0.08);
    border-color: rgba(255, 193, 7, 0.3);
}

.stat-header {
    font-size: 12px;
    font-weight: 600;
    color: #10b981;
    margin-bottom: 8px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 2.5rem; /* Responsive font size */
    font-weight: 700;
    color: #ffffff;
    margin: 1rem 0;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    line-height: 1.1;
    display: block;
    text-align: left;
    word-wrap: break-word; /* Wrap long values */
}

.stat-subtext {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
    margin-top: auto; /* Pushes subtext to the bottom */
}

.chart-container {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
    backdrop-filter: blur(40px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    height: 300px;
    display: flex;
    flex-direction: column;
}

.chart-container canvas {
    flex: 1;
    max-height: 200px !important;
    height: 200px !important;
}

.chart-title {
    font-size: 18px;
    font-weight: 600;
    color: #10b981;
    margin-bottom: 4px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

.chart-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 20px;
    font-weight: 400;
}

.stat-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 24px;
    backdrop-filter: blur(40px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.stat-panel-title {
    font-size: 18px;
    font-weight: 600;
    color: #10b981;
    margin-bottom: 16px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

.stat-panel-content {
    color: #ffffff;
}

.response-time-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.response-time-stat:last-child {
    border-bottom: none;
}

.response-time-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
}

.response-time-value {
    font-size: 16px;
    color: #ffffff;
    font-weight: 600;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

.top-tags-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.top-tag-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.top-tag-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}

.top-tag-rank {
    font-size: 14px;
    color: #10b981;
    font-weight: 600;
    margin-right: 12px;
    min-width: 20px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

.top-tag-name {
    flex: 1;
    font-size: 14px;
    color: #ffffff;
    font-weight: 500;
}

.top-tag-count {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

.active-users-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.active-users-stat:last-child {
    border-bottom: none;
}

.active-users-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
}

.active-users-value {
    font-size: 18px;
    color: #ffffff;
    font-weight: 600;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

/* Chart.js custom styling */
.chart-container canvas {
    background: transparent !important;
}

/* Statistics page specific styles */
.container.mx-auto.p-4 {
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    min-height: 100vh;
    color: #ffffff;
    padding: 16px !important;
    max-width: none !important;
}

/* Responsive adjustments for statistics */

/* Responsive adjustments for statistics */
@media (max-width: 768px) {
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 24px;
    }
    
    .chart-container {
        padding: 16px;
    }
    
    .stat-panel {
        padding: 16px;
    }
}

/* Animation for statistics loading */
@keyframes statLoad {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.stat-card, .chart-container, .stat-panel {
    animation: statLoad 0.5s ease-out;
}

/* Staggered animation for multiple cards */
.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

/* ========================================
   FULLSCREEN PROMPT EDITOR
   ======================================== */

.prompt-editor-modal {
    z-index: 9999;
    background: #000000 !important;
    backdrop-filter: none !important;
}

.prompt-editor-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #000000;
}

/* Compact Header - Only Essential Controls */
.prompt-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(10, 10, 10, 0.98);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    min-height: 60px;
    max-height: 60px;
    z-index: 10;
}

.prompt-editor-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    min-width: 0;
}

.prompt-editor-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.prompt-editor-title {
    font-size: 16px;
    font-weight: 600;
    color: #10b981;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    white-space: nowrap;
    letter-spacing: 0.5px;
    margin: 0;
}

.prompt-name-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    transition: all 0.2s ease !important;
    max-width: 500px;
}

.prompt-name-input:focus {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

.prompt-name-input::placeholder {
    color: rgba(255, 255, 255, 0.3) !important;
}

.prompt-save-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border: 1px solid rgba(16, 185, 129, 0.3) !important;
    color: #ffffff !important;
    padding: 10px 24px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace !important;
    transition: all 0.2s ease !important;
    cursor: pointer;
    white-space: nowrap;
}

.prompt-save-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

.prompt-save-btn:active {
    transform: translateY(0);
}

.prompt-save-btn:disabled {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: rgba(255, 255, 255, 0.3) !important;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.prompt-close-btn {
    background: rgba(255, 59, 48, 0.1) !important;
    border: 1px solid rgba(255, 59, 48, 0.3) !important;
    color: #FF3B30 !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    font-size: 24px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    transition: all 0.2s ease !important;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.prompt-close-btn:hover {
    background: rgba(255, 59, 48, 0.2) !important;
    border-color: rgba(255, 59, 48, 0.5) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 59, 48, 0.2) !important;
}

/* Main Editor Body - Maximum Space */
.prompt-editor-body {
    flex: 1;
    display: flex;
    overflow: hidden;
    background: #000000;
    padding: 0;
    margin: 0;
}

.prompt-editor-textarea {
    flex: 1;
    width: 100% !important;
    height: 100% !important;
    background: #000000 !important;
    border: none !important;
    color: #ffffff !important;
    padding: 32px 40px !important;
    font-size: 16px !important;
    line-height: 1.8 !important;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace !important;
    font-weight: 400 !important;
    resize: none !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-y: auto;
    overflow-x: hidden;
    white-space: pre-wrap;
    word-wrap: break-word;
    tab-size: 4;
}

.prompt-editor-textarea::placeholder {
    color: rgba(255, 255, 255, 0.2) !important;
}

.prompt-editor-textarea:focus {
    background: #000000 !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* Custom Scrollbar for Textarea */
.prompt-editor-textarea::-webkit-scrollbar {
    width: 12px;
}

.prompt-editor-textarea::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.prompt-editor-textarea::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.prompt-editor-textarea::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
    background-clip: padding-box;
}

/* Footer - Minimal Info */
.prompt-editor-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 8px 20px;
    background: rgba(10, 10, 10, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    min-height: 40px;
    max-height: 40px;
}

.prompt-char-counter {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-weight: 400;
}

/* Responsive Design for Smaller Screens */
@media (max-width: 768px) {
    .prompt-editor-header {
        padding: 10px 16px;
        min-height: 56px;
        max-height: 56px;
    }
    
    .prompt-editor-header-left {
        gap: 12px;
    }
    
    .prompt-editor-title {
        font-size: 14px;
    }
    
    .prompt-name-input {
        font-size: 14px !important;
        padding: 6px 12px !important;
        max-width: none;
    }
    
    .prompt-save-btn {
        padding: 8px 16px !important;
        font-size: 13px !important;
    }
    
    .prompt-close-btn {
        width: 40px;
        height: 40px;
        font-size: 20px !important;
    }
    
    .prompt-editor-textarea {
        padding: 20px 16px !important;
        font-size: 15px !important;
        line-height: 1.6 !important;
    }
    
    .prompt-editor-footer {
        padding: 6px 16px;
        min-height: 36px;
        max-height: 36px;
    }
}

@media (max-width: 480px) {
    .prompt-editor-header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .prompt-name-input {
        width: 100%;
    }
    
    .prompt-editor-textarea {
        padding: 16px 12px !important;
        font-size: 14px !important;
    }
}

/* Animation for Modal Open/Close */
@keyframes promptEditorFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.prompt-editor-modal:not(.hidden) {
    animation: promptEditorFadeIn 0.15s ease-out;
}

/* Disable Selection on Header Elements */
.prompt-editor-header * {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

/* Enable Selection in Textarea */
.prompt-editor-textarea {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
}
