/* ========================================
   V2RAY IRAN - DARK MODE THEME
   ======================================== */

/* Main body dark mode */
body.dark-mode {
  background: #0F0F1A !important;
  color: #E8E8F0 !important;
}

/* Login page */
body.dark-mode .login-container {
  background: #0F0F1A !important;
}
body.dark-mode .login-card {
  background: #1A1A2E !important;
  border-color: #2A2A4A !important;
}

/* Cards and containers */
body.dark-mode .glass-card,
body.dark-mode .stat-card,
body.dark-mode .card,
body.dark-mode .action-bar,
body.dark-mode .table-container {
  background: #1A1A2E !important;
  border-color: #2A2A4A !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3) !important;
}

/* Sessions list */
body.dark-mode .sessions-list {
  background: #1A1A2E !important;
  border-color: #2A2A4A !important;
}

body.dark-mode .sessions-list .section-title {
  background: #0F0F1A !important;
  color: #E8E8F0 !important;
  border-bottom-color: #2A2A4A !important;
}

body.dark-mode .session-item {
  border-bottom-color: #2A2A4A !important;
  background: #1A1A2E !important;
}

body.dark-mode .session-item:hover {
  background: #2A2A4A !important;
}

/* IMPORTANT: DO NOT override session-info background - keep it white */

body.dark-mode .session-info h4 {
  color: #1A1A2E !important;
}

body.dark-mode .session-info .session-time {
  color: #4A4A6A !important;
}

body.dark-mode .badge-waiting {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #FBBF24 !important;
}

body.dark-mode .badge-active {
  background: rgba(34, 197, 94, 0.2) !important;
  color: #4ADE80 !important;
}

body.dark-mode .badge-closed {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #F87171 !important;
}

body.dark-mode .empty-state {
  color: #8888AA !important;
}

/* Chat page */
body.dark-mode .chat-container {
  background: #0F0F1A !important;
}

body.dark-mode .messages-container {
  background: #0F0F1A !important;
}

body.dark-mode .message-customer {
  background: #2A2A4A !important;
  border-color: #3A3A5A !important;
  color: #E8E8F0 !important;
}

body.dark-mode .message-customer .message-time {
  color: #8888AA !important;
}

body.dark-mode .message-admin {
  background: var(--gradient-primary) !important;
  color: white !important;
}

body.dark-mode .input-area {
  background: #1A1A2E !important;
  border-color: #2A2A4A !important;
}

body.dark-mode .input-area input {
  background: #2A2A4A !important;
  border-color: #3A3A5A !important;
  color: #E8E8F0 !important;
}

body.dark-mode .input-area input:focus {
  border-color: var(--primary) !important;
  background: #1A1A2E !important;
}

body.dark-mode .input-area button {
  background: var(--gradient-primary) !important;
  color: white !important;
}

body.dark-mode .typing-indicator {
  background: #0F0F1A !important;
  color: #8888AA !important;
}

body.dark-mode .session-closed-banner {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #F87171 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}

body.dark-mode .chat-header {
  background: var(--gradient-secondary) !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4) !important;
}

body.dark-mode .chat-header .back-btn {
  color: white !important;
}

/* Admin dashboard */
body.dark-mode .dashboard-container {
  background: #0F0F1A !important;
}

body.dark-mode .table-container {
  background: #1A1A2E !important;
  border-color: #2A2A4A !important;
}

body.dark-mode th {
  background: #0F0F1A !important;
  color: #B8B8D0 !important;
}

body.dark-mode td {
  border-bottom-color: #2A2A4A !important;
  color: #E8E8F0 !important;
}

body.dark-mode tr:hover {
  background: #2A2A4A !important;
}

body.dark-mode .badge-unread {
  background: var(--gradient-primary) !important;
  color: white !important;
}

/* App header */
body.dark-mode .app-header {
  background: var(--gradient-secondary) !important;
  box-shadow: 0 4px 24px rgba(0,0,0,0.4) !important;
}

body.dark-mode .app-header .logo h1 {
  color: white !important;
}

/* Inputs */
body.dark-mode .input-field {
  background: #2A2A4A !important;
  border-color: #3A3A5A !important;
  color: #E8E8F0 !important;
}

body.dark-mode .input-field:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 4px rgba(91, 119, 238, 0.15) !important;
  background: #1A1A2E !important;
}

body.dark-mode .input-field::placeholder {
  color: #8888AA !important;
}

/* Info text */
body.dark-mode .info-text,
body.dark-mode .highlight-text {
  background: #0F0F1A !important;
  color: #B8B8D0 !important;
}

body.dark-mode label {
  color: #B8B8D0 !important;
}

body.dark-mode .login-logo p {
  color: #B8B8D0 !important;
}

/* Theme toggle */
body.dark-mode .theme-toggle-wrapper {
  background: rgba(255,255,255,0.05) !important;
  border-color: rgba(255,255,255,0.05) !important;
}

body.dark-mode .switch {
  background: rgba(255,255,255,0.1) !important;
  border-color: rgba(255,255,255,0.15) !important;
}

body.dark-mode .switch.active {
  background: rgba(91, 119, 238, 0.3) !important;
}

body.dark-mode .switch .slider {
  background: #E8E8F0 !important;
}

body.dark-mode .switch.active .slider {
  background: #5B77EE !important;
}

body.dark-mode .theme-icon {
  color: #E8E8F0 !important;
}

/* Username taken box */
body.dark-mode .username-taken-box {
  background: rgba(239, 68, 68, 0.1) !important;
  border-color: rgba(239, 68, 68, 0.2) !important;
  color: #F87171 !important;
}

body.dark-mode .username-taken-box .btn-choose-other {
  border-color: #F87171 !important;
  color: #F87171 !important;
}

body.dark-mode .username-taken-box .btn-choose-other:hover {
  background: #F87171 !important;
  color: #1A1A2E !important;
}

/* Stat cards */
body.dark-mode .stat-card .stat-value {
  background: var(--gradient-primary) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

body.dark-mode .stat-card .stat-label {
  color: #B8B8D0 !important;
  -webkit-text-fill-color: #B8B8D0 !important;
}

/* Login card */
body.dark-mode .login-card::before {
  background: var(--gradient-primary) !important;
}

/* Buttons in dark mode */
body.dark-mode .btn-secondary {
  background: transparent !important;
  color: var(--primary-light) !important;
  border-color: #3A3A5A !important;
}

body.dark-mode .btn-secondary:hover {
  border-color: var(--primary) !important;
  background: rgba(91, 119, 238, 0.1) !important;
}

body.dark-mode .btn-ghost {
  color: #B8B8D0 !important;
}

body.dark-mode .btn-ghost:hover {
  background: rgba(91, 119, 238, 0.1) !important;
  color: var(--primary-light) !important;
}

body.dark-mode .btn-primary {
  background: var(--gradient-primary) !important;
  color: white !important;
}

body.dark-mode .btn-warning {
  background: #F59E0B !important;
  color: white !important;
}

body.dark-mode .btn-danger {
  background: #EF4444 !important;
  color: white !important;
}

body.dark-mode .btn-refresh {
  background: var(--primary-secondary) !important;
  color: white !important;
}

body.dark-mode .btn-xray {
  background: #6f42c1 !important;
  color: white !important;
}

body.dark-mode .btn-chat {
  background: var(--gradient-primary) !important;
  color: white !important;
}

body.dark-mode .btn-close {
  background: #EF4444 !important;
  color: white !important;
}

/* Message time in dark mode */
body.dark-mode .message-time {
  color: rgba(255,255,255,0.6) !important;
}

body.dark-mode .message-customer .message-time {
  color: #8888AA !important;
}

/* Scrollbar */
body.dark-mode::-webkit-scrollbar-track {
  background: #0F0F1A !important;
}

body.dark-mode::-webkit-scrollbar-thumb {
  background: var(--primary-secondary) !important;
}

body.dark-mode::-webkit-scrollbar-thumb:hover {
  background: var(--primary) !important;
}
