:root {
    /* New Design Colors - Updated */
    --primary-color: #27b399;
    --primary-dark: #00a844;
    --primary-light: #818cf8;
    --secondary-color: #2196f3;
    --accent-color: #f59e0b;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --success-color: #22c55e;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    --text-primary: #ffffff;
    --text-secondary: #9e9e9e;
    --text-muted: #64748b;
    --border-color: #334155;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
    --reply-bg: rgb(147 11 1);
    --reply-user-color: #ffffff;
    --reply-border: #ffffff;
    --reply-message-bg: rgba(0, 255, 0, 0.1); /* Bright green with 10% opacity */
    --other-user-bg: var(--bg-secondary);
    
    /* Old Cyber Design Colors (kept for reference) */
    --bg-body: #050507;
    --bg-glass: rgba(20, 20, 25, 0.65);
    --bg-glass-heavy: rgba(10, 10, 12, 0.85);
    --border-glass: rgba(255, 255, 255, 0.08);
    --primary-glow: rgba(99, 102, 241, 0.5);
    --secondary-glow: rgba(217, 70, 239, 0.5);
    --accent-cyan: #06b6d4;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* Left Sidebar */
.sidebar-left {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    z-index: 1000;
    position: relative;
}

@media (max-width: 992px) {
    .sidebar-left {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transition: left 0.3s ease;
    }

    .sidebar-left.mobile-open {
        left: 0;
    }
}

.logo-section {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-title {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.logo-title img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
}

.logo-title h1 {
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-sections {
    flex: 1;
    padding: 15px 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    
    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #27b399 var(--bg-tertiary);
}

/* Webkit browsers (Chrome, Safari, Edge) */
.sidebar-sections::-webkit-scrollbar {
    width: 6px;
}

.sidebar-sections::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.sidebar-sections::-webkit-scrollbar-thumb {
    background: #27b399;
    border-radius: 3px;
}

.sidebar-sections::-webkit-scrollbar-thumb:hover {
    background: #1e8b7a;
}

.sidebar-section {
    margin-bottom: 20px;
}

.sidebar-section h3 {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-section h3 i {
    color: var(--primary-color);
    width: 20px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    cursor: pointer;
}

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

.profile-avatar {
    text-align: center;
    margin-bottom: 1rem;
}

.profile-avatar img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
    object-fit: cover;
}

.profile-username {
    font-weight: 700;
    margin-top: 10px;
    font-size: 1rem;
}

.profile-role {
    font-size: 0.8rem;
    color: var(--accent-color);
    margin-top: 5px;
}

.btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.online-count {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.online-dot {
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.user-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    transition: var(--transition);
}

.user-row:hover {
    background: var(--bg-card);
}

.user-row img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.3);
    object-fit: cover;
}

.user-row span {
    font-size: 0.9rem;
    font-weight: 500;
}

#staff-online-list {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.footer-legal-links {
    list-style: none;
    margin-bottom: 15px;
}

.footer-legal-links li {
    margin-bottom: 8px;
}

.footer-legal-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
}

.footer-legal-links a:hover {
    color: var(--primary-color);
    transform: translateX(3px);
}

.footer-legal-links a:before {
    display: none; /* Remove the bullet since we're using icons */
}

.footer-legal-links a i {
    color: #27b399;
    font-size: 0.9rem;
    width: 18px;
    text-align: center;
    transition: var(--transition);
}

.footer-legal-links a:hover i {
    color: var(--primary-color);
    transform: scale(1.1);
}

.footer-copyright-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.user-section {
    padding: 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
    position: relative;
}

.user-avatar .status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: var(--success-color);
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
}

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

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--primary-light);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-header {
    padding: 15px 25px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 997;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-title h2 {
    font-size: 1.3rem;
    font-weight: 600;
}

.chat-title .room-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.room-status .live-dot {
    width: 8px;
    height: 8px;
    background: var(--success-color);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.chat-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-nav-buttons {
    display: flex;
    gap: 8px;
    margin-right: 15px;
}

.chat-nav-btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

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

.chat-nav-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.chat-nav-btn.logout {
    background: var(--danger-color);
    color: white;
}

.chat-nav-btn.logout:hover {
    background: #dc2626;
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Messages Container */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    scroll-behavior: smooth;
}

.messages-container::-webkit-scrollbar {
    width: 6px;
}

.messages-container::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.messages-container::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

.modal-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-close {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--danger-color);
    color: white;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(85vh - 140px);
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

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

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
}

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

/* Unread Indicator */
.unread-indicator {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    display: none;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: bounce 1s infinite;
    border: 2px solid rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
    font-weight: 500;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-5px); }
}

.unread-indicator.show {
    display: flex;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingDot 1.4s infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

/* Reply Preview */
.reply-preview {
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--primary-color);
    border-radius: var(--radius-sm);
    padding: 10px 15px;
    margin: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
    display: none;
    animation: slideDown 0.3s ease;
}

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

.reply-preview.active {
    display: flex;
}

.reply-preview-content {
    font-size: 0.9rem;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.reply-preview-content #replyToUser {
    color: var(--primary-color);
    font-weight: 600;
}

.reply-preview-content #replyToText {
    color: var(--text-secondary);
    font-style: italic;
}

.reply-preview-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0 0 0 10px;
    transition: color 0.2s;
}

.reply-preview-close:hover {
    color: var(--danger-color);
}

/* DMCA Notice */
.dmca-notice-main {
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid #ef4444;
    padding: 12px 15px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
    width: 100%;
}

.dmca-notice-main a {
    color: #ef4444;
    font-weight: 600;
    text-decoration: underline;
    transition: color 0.3s;
}

.dmca-notice-main a:hover {
    color: #dc2626;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .chat-nav-buttons {
        display: none;
    }
    
    .mobile-nav-menu {
        display: block;
    }
    
    .main-content {
        padding-bottom: 70px;
    }
    
    .messages-container {
        padding-bottom: 160px !important;
        min-height: calc(100vh - 200px);
        margin-bottom: 0;
    }
    
    .message-input-area {
        position: fixed;
        bottom: 70px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        padding: 15px;
        border-top: 1px solid var(--border-color);
        border-bottom: 1px solid var(--border-color);
        z-index: 999;
        margin-bottom: 0;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }
    
    .unread-indicator {
        bottom: 160px !important;
        z-index: 1000;
        padding: 10px 18px;
        font-size: 0.85rem;
        min-width: 180px;
    }
    
    @supports (-webkit-touch-callout: none) {
        .mobile-nav-menu {
            height: calc(70px + env(safe-area-inset-bottom, 0px));
        }
        
        .message-input-area {
            bottom: calc(70px + env(safe-area-inset-bottom, 0px));
        }
        
        .unread-indicator {
            bottom: calc(160px + env(safe-area-inset-bottom, 0px)) !important;
        }
    }
}

@media (max-width: 768px) {
    .chat-header {
        padding: 10px 15px;
    }
    
    .messages-container {
        padding: 10px;
    }
    
    .message-input-area {
        padding: 10px 15px;
    }
    
    .message {
        max-width: 90%;
    }
}

@media (max-width: 576px) {
    .messages-container {
        padding: 8px;
    }
    
    .message-input-area {
        padding: 8px 12px;
    }
    
    .message {
        max-width: 95%;
    }
    
    .product-card {
        width: 100%;
        max-width: 280px;
    }
}

/* Staff username border decoration */
.msg-info .admin-username,
.msg-info .mod-username {
    border: 2px solid #27b399;
    border-top-left-radius: 60px;
    border-top-right-radius: 1px;
    border-bottom-left-radius: 1px;
    border-bottom-right-radius: 60px;
    padding: 2px 8px;
    font-weight: bold;
}

.msg-info .admin-username {
    color: #27b399;
    background: rgba(39, 179, 153, 0.1);
}

.msg-info .mod-username {
    color: #06b6d4;
    background: rgba(6, 182, 212, 0.1);
}

/* Notification Container */
#notificationContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
}

.notification {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(16px);
    animation: slideInRight 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.notification.success {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(16, 185, 129, 0.1);
}

.notification.success .notif-icon { color: #10b981; }

.notification.info {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(99, 102, 241, 0.1);
}

.notification.info .notif-icon { color: var(--primary-color); }

.notification.danger {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.1);
}

.notification.danger .notif-icon { color: #ef4444; }

.notif-icon { font-size: 1.2rem; }

.notif-content {
    flex: 1;
}

.notif-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.notif-message {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.notif-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notif-close:hover { color: var(--text-primary); }

@keyframes slideInRight {
    from { 
        opacity: 0; 
        transform: translateX(100px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

@keyframes slideOutRight {
    from { 
        opacity: 1; 
        transform: translateX(0); 
    }
    to { 
        opacity: 0; 
        transform: translateX(100px); 
    }
}

.bot-details-content {
    font-size: clamp(0.75rem, 2vw, 1rem);
    word-break: break-word;
    overflow-wrap: break-word;
}