/* ===================================
   Dashboard - Bootstrap 5 Overrides
   RedCuby Support System
   Green Fresh Palette
   =================================== */

:root {
    --rc-green: #10b981;
    --rc-green-dark: #059669;
    --rc-cyan: #06b6d4;
    --rc-orange: #fb923c;
    --rc-purple: #8b5cf6;
    --rc-sidebar: #1a202c;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: #f7f8fc;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 250px;
    background: var(--rc-sidebar);
    z-index: 1040;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.text-accent { color: var(--rc-green) !important; }

.btn-accent {
    background: var(--rc-purple);
    border-color: var(--rc-purple);
    color: #fff;
}

.btn-accent:hover {
    background: #7c3aed;
    border-color: #7c3aed;
    color: #fff;
}

.sidebar .nav-link {
    color: #a0aec0;
    font-size: 13px;
    font-weight: 500;
    padding: 9px 14px;
    border-radius: 6px;
    margin-bottom: 2px;
    transition: all 0.15s ease;
}

.sidebar .nav-link:hover {
    color: #cbd5e1;
    background: rgba(255,255,255,0.06);
}

.sidebar .nav-link.active {
    background: rgba(16, 185, 129, 0.12);
    color: var(--rc-green);
}

/* Submenu styling */
.sidebar .nav-link[data-bs-toggle="collapse"] {
    cursor: pointer;
}

.sidebar .collapse.show {
    margin-top: 4px;
    margin-bottom: 4px;
}

.sidebar .collapse .nav-link {
    padding: 7px 14px;
    font-size: 12px;
    color: #94a3b8;
    border-left: 2px solid transparent;
    margin-left: 8px;
}

.sidebar .collapse .nav-link:hover {
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.05);
    border-left-color: rgba(16, 185, 129, 0.3);
}

.sidebar .collapse .nav-link.active {
    background: rgba(16, 185, 129, 0.08);
    color: var(--rc-green);
    border-left-color: var(--rc-green);
}

/* Chat Input Styles */
/* Message Reply Form Styles */
.message-reply-form {
    width: 100%;
}

.message-input-container {
    padding: 0;
}

.message-input-field {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 24px;
    padding: 8px 12px;
    transition: all 0.2s ease;
}

.message-input-field:focus-within {
    border-color: #5b7cfa;
    box-shadow: 0 0 0 3px rgba(91, 124, 250, 0.08);
}

.attach-btn-wrapper {
    position: relative;
    flex-shrink: 0;
}

.attach-icon-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    padding: 6px 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.attach-icon-btn:hover {
    color: #10b981;
}

.attach-icon-btn:active {
    transform: scale(0.95);
}

.reply-textarea {
    flex: 1;
    background: none;
    border: none;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    min-height: 24px;
    max-height: 120px;
    color: #333;
    outline: none;
    padding: 6px 4px;
}

.reply-textarea::placeholder {
    color: #aaa;
}

.reply-textarea::-webkit-scrollbar {
    width: 4px;
}

.reply-textarea::-webkit-scrollbar-track {
    background: transparent;
}

.reply-textarea::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

.reply-textarea::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

.send-icon-btn {
    background: #5b7cfa;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    cursor: pointer;
    color: #fff;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.send-icon-btn:hover:not(:disabled) {
    background: #4c6ef5;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(91, 124, 250, 0.4);
}

.send-icon-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.send-icon-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

.send-icon-btn .spinner-border {
    width: 14px;
    height: 14px;
}

/* File counter styling */
.file-counter {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
    text-align: center;
}


.dropdown-menu {
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.dropdown-item {
    padding: 8px 12px;
    font-size: 13px;
    color: #333;
}

.dropdown-item:hover {
    background-color: #f0f0f0;
    color: #10b981;
}

.dropdown-item i {
    color: currentColor;
}

/* File Preview Styles */
.file-preview-container {
    margin-bottom: 8px;
}

.file-preview-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.file-preview-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #333;
}

.file-preview-item i {
    color: #10b981;
    font-size: 14px;
}

.file-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-remove {
    background: none;
    border: none;
    padding: 0;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    margin-left: 4px;
    transition: color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-remove:hover {
    color: #ef4444;
}

/* Image Preview Styles */
.image-preview-item {
    display: inline-block;
}

.image-preview-wrapper {
    position: relative;
    display: inline-block;
}

.image-preview-thumb {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.image-preview-thumb:hover {
    border-color: #10b981;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
    transform: scale(1.02);
}

.image-preview-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    padding: 0;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.image-preview-remove:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Chat Attachments Styles */
.chat-attachments-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.chat-image-link {
    display: inline-block;
    text-decoration: none;
}

.chat-thumb {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-thumb:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.chat-files-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

.chat-file-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    text-decoration: none;
    color: #666;
    font-size: 12px;
    transition: all 0.2s ease;
    width: fit-content;
}

.chat-file-link:hover {
    background: #fff;
    border-color: #10b981;
    color: #10b981;
}

.chat-file-link-admin {
    background: #f0f0f0;
    color: #333;
}

.chat-file-link-admin:hover {
    background: #fff;
    border-color: #5b7cfa;
    color: #5b7cfa;
}

.sidebar .form-control {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}

.sidebar .form-control:focus {
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-color: var(--rc-green) !important;
    box-shadow: none;
}

.sidebar .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: 250px;
    min-height: 100vh;
}

/* ===== STAT CARDS ===== */
.stat-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-icon {
    font-size: 40px;
    opacity: 0.8;
}

.text-purple { color: var(--rc-purple) !important; }

/* ===== AVATAR ===== */
.avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6ee7b7, var(--rc-green));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 12px;
}

/* ===== TICKETS TABLE ===== */
.ticket-row {
    transition: background 0.15s;
}

.ticket-row:hover {
    background: #f9fafb;
}

/* ===== SIDEBAR OVERLAY (mobile) ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1035;
}

.sidebar-overlay.show {
    display: block;
}

/* ===== NAVBAR FLAGS ===== */
.navbar .fi {
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 2px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }
}

@media print {
    .sidebar, .navbar { display: none !important; }
    .main-content { margin-left: 0; }
}
