/* Styles for Dashboard Layout (dashboard_new.html) */

/* CSS Variables */
:root {
  --header-height: 70px;
  --footer-height: 60px;
  --transition-speed: 0.3s;
  --turquoise: #00C4B4; /* WhatsApp green */
  --dark-sidebar: #1A1A2E;
  --dark-card: #2A2A3E;
  --dark-text: #E0E0E0;
  --dark-border: #3A3A4E;
  --light-sidebar: #F0F2F5;
  --light-card: #FFFFFF;
  --light-text: #333333;
  --light-border: #D1D5DB;
  --shadow-light: rgba(0, 0, 0, 0.1);
}

/* Report buttons: make the selected/active report pill use the primary button color */
.report-buttons .btn,
.reports-toggle .btn,
.report-toggle .btn {
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 6px 12px;
  border: 1px solid transparent;
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.report-buttons .btn:hover,
.reports-toggle .btn:hover,
.report-toggle .btn:hover {
  filter: brightness(0.98);
}

/* Active/selected state (support .active class and ARIA pressed/selected attributes) */
.report-buttons .btn.active,
.reports-toggle .btn.active,
.report-toggle .btn.active,
.report-buttons .btn[aria-pressed="true"],
.report-buttons .btn[aria-selected="true"],
.reports-toggle .btn[aria-pressed="true"],
.reports-toggle .btn[aria-selected="true"] {
  background: var(--turquoise) !important;
  color: #ffffff !important;
  border-color: var(--turquoise) !important;
  box-shadow: 0 6px 18px rgba(10,97,87,0.18);
}

/* Ensure accessibility: darken focus ring when keyboard focused */
.report-buttons .btn:focus,
.reports-toggle .btn:focus,
.report-toggle .btn:focus {
  outline: 3px solid rgba(0,196,180,0.12);
  outline-offset: 2px;
}

/* Dashboard Page Specific Styles */
.dashboard-page {
  margin: 0;
  padding: 0;
}

.dashboard-layout {
  display: flex;
  min-height: 100vh;
  flex-direction: row;
  width: 100%;
}

/* Sidebar Styles */
.sidebar {
  width: 260px;
  min-width: 260px;
  height: 100vh;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Assistant chat modal - refined layout */
.assistant-chat-modal .assistant-chat-content {
  background: linear-gradient(160deg, rgba(31, 34, 56, 0.95), rgba(16, 20, 36, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  border-radius: 18px;
  width: min(520px, 94vw);
  max-height: 86vh;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
  padding: 18px;
}

body.light-mode .assistant-chat-modal .assistant-chat-content {
  background: #ffffff;
  color: var(--light-text);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.15);
}

.assistant-chat-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.light-mode .assistant-chat-modal .modal-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.assistant-chat-modal .welcome-message {
  background: rgba(255, 255, 255, 0.04);
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.95rem;
  color: #dbe6ff;
}

body.light-mode .assistant-chat-modal .welcome-message {
  background: rgba(0, 0, 0, 0.03);
  color: var(--light-text);
}

.assistant-chat-modal .chat-messages {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 14px;
  overflow-y: auto;
  min-height: 260px;
  max-height: 50vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.assistant-chat-modal .message {
  padding: 10px 12px;
  border-radius: 12px;
  max-width: 85%;
  line-height: 1.5;
  font-size: 0.95rem;
}

.assistant-chat-modal .message.user {
  margin-left: auto;
  background: linear-gradient(135deg, var(--turquoise), #00e0c4);
  color: #0b1c26;
}

.assistant-chat-modal .message.bot {
  background: rgba(255, 255, 255, 0.06);
  color: #e7eefc;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

body.light-mode .assistant-chat-modal .message.bot {
  background: #f3f6fb;
  color: #1a1f2b;
  border-color: rgba(0, 0, 0, 0.04);
}

.assistant-chat-modal .chat-input {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.assistant-chat-modal .chat-input input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #e7eefc;
  padding: 12px 14px;
}

body.light-mode .assistant-chat-modal .chat-input input {
  background: #fff;
  color: var(--light-text);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.assistant-chat-modal .chat-input button {
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--turquoise), #00e0c4);
  color: #0b1c26;
  padding: 12px 16px;
  cursor: pointer;
  box-shadow: 0 12px 25px rgba(0, 196, 180, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.assistant-chat-modal .chat-input button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 28px rgba(0, 196, 180, 0.4);
}

@media (max-width: 768px) {
  .assistant-chat-modal .assistant-chat-content {
    width: 94vw;
    max-height: 88vh;
    padding: 14px;
  }

  .assistant-chat-modal .chat-messages {
    max-height: 52vh;
  }
}

body.dark-mode .sidebar {
  background-color: var(--dark-sidebar);
  border-left: 1px solid var(--dark-border);
}

body.light-mode .sidebar {
  background-color: var(--light-sidebar);
  border-left: 1px solid var(--light-border);
}

.sidebar.collapsed {
  width: 70px;
  min-width: 70px;
}

.sidebar.collapsed .sidebar-logo span,
.sidebar.collapsed .sidebar-nav .nav-item span {
  display: none;
}

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

body.light-mode .sidebar-header {
  border-bottom: 1px solid var(--light-border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.4em;
  font-weight: bold;
  color: var(--turquoise);
}

.sidebar-logo i {
  font-size: 1.5em;
}

.sidebar-toggle {
  background: transparent;
  border: none;
  color: var(--dark-text);
  font-size: 1.2em;
  cursor: pointer;
  padding: 5px;
  transition: color 0.3s;
}

body.light-mode .sidebar-toggle {
  color: var(--light-text);
}

.sidebar-toggle:hover {
  color: var(--turquoise);
}

.sidebar-nav {
  flex: 1;
  padding: 10px 0;
}

.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 20px;
  color: var(--dark-text);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  cursor: pointer;
}

body.light-mode .sidebar-nav .nav-item {
  color: var(--light-text);
}

.sidebar-nav .nav-item i {
  font-size: 1.3em;
  min-width: 25px;
  text-align: center;
}

.sidebar-nav .nav-item span {
  font-size: 1em;
  white-space: nowrap;
}

.sidebar-nav .nav-item:hover {
  background-color: rgba(0, 196, 180, 0.1);
  color: var(--turquoise);
}

.sidebar-nav .nav-item.active {
  background-color: var(--turquoise);
  color: white;
  border-right: 4px solid #0a6157;
}

.sidebar-nav .nav-item.active i {
  color: white;
}

/* Sidebar Footer Actions */
.sidebar-footer {
  padding: 15px;
  border-top: 1px solid var(--dark-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

body.light-mode .sidebar-footer {
  border-top: 1px solid var(--light-border);
}

.sidebar-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1em;
  width: 100%;
  text-align: right;
  background: transparent;
  color: var(--light-text);
}

body.dark-mode .sidebar-action-btn {
  color: #FFFFFF;
}

body.light-mode .sidebar-action-btn {
  color: var(--light-text);
}

.sidebar-footer .sidebar-action-btn:hover {
  background-color: rgba(0, 196, 180, 0.1);
  color: var(--turquoise);
}

.sidebar-footer .sidebar-action-btn i {
  font-size: 1.2em;
  min-width: 25px;
  text-align: center;
}

.sidebar-footer .sidebar-action-btn span {
  font-size: 0.95em;
  white-space: nowrap;
}

.sidebar.collapsed .sidebar-footer .sidebar-action-btn span {
  display: none;
}

.sidebar-footer .logout-btn {
  background-color: rgba(255, 59, 48, 0.1);
  color: #FF3B30;
}

.sidebar-footer .logout-btn:hover {
  background-color: rgba(255, 59, 48, 0.2);
}

body.dark-mode .sidebar-footer .logout-btn {
  background-color: rgba(255, 59, 48, 0.15);
  color: #FFFFFF;
}

body.dark-mode .sidebar-footer .logout-btn:hover {
  background-color: rgba(255, 59, 48, 0.25);
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
  padding: 5px 10px;
  color: var(--dark-text);
}

body.light-mode .mobile-menu-btn {
  color: var(--light-text);
}

.mobile-menu-btn:hover {
  color: var(--turquoise);
}

/* Main Content Area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  padding-right: 260px;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.sidebar.collapsed ~ .main-content {
  width: 100%;
  padding-right: 70px;
}

@media (max-width: 768px) {
  .main-content {
    padding-right: 0;
  }
  
  .sidebar.collapsed ~ .main-content {
    padding-right: 0;
  }
}

/* Main Header */
.main-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 25px;
  position: sticky;
  top: 0;
  z-index: 1002;
  transition: background-color var(--transition-speed) ease;
}

body.dark-mode .main-header {
  background-color: rgba(26, 26, 46, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--dark-border);
}

body.light-mode .main-header {
  background-color: rgba(240, 242, 245, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--light-border);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.bot-selector-container {
  position: relative;
  min-width: 200px;
}

.form-group.bot-selector {
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-group.bot-selector label {
  font-size: 0.9em;
  opacity: 0.8;
  white-space: nowrap;
}

#botSelectDashboard {
  padding: 10px 35px 10px 15px; /* RTL padding */
  border-radius: 6px;
  border: 1px solid;
  min-width: 180px;
  font-size: 1em;
  appearance: none;
  background-repeat: no-repeat;
  background-position: left 10px center; /* RTL */
}

body.dark-mode #botSelectDashboard {
  background-color: var(--dark-card);
  color: var(--dark-text);
  border-color: var(--dark-border);
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23e0e0e0" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
}

body.light-mode #botSelectDashboard {
  background-color: var(--light-card);
  color: var(--light-text);
  border-color: var(--light-border);
  background-image: url('data:image/svg+xml;utf8,<svg fill="%23333333" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
}

body.dark-mode #botSelectDashboard option {
  background: var(--dark-card);
  color: var(--dark-text);
}

body.light-mode #botSelectDashboard option {
  background: var(--light-card);
  color: var(--light-text);
}

/* Header Icons */
.header-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.8em;
  padding: 8px;
  position: relative;
  transition: transform 0.2s;
}

body.dark-mode .header-icon-btn {
  color: var(--dark-text);
}

body.light-mode .header-icon-btn {
  color: var(--light-text);
}

.header-icon-btn:hover {
  color: var(--turquoise);
  transform: scale(1.1);
}

.notifications-count {
  position: absolute;
  top: 0;
  left: 0;
  background-color: red;
  color: white;
  font-size: 0.8em;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  display: none;
}

.header-icon-btn.has-unread .notifications-count {
  display: flex;
}

/* Welcome Bar */
.welcome-bar {
  display: flex;
  align-items: center;
  gap: 15px;
  background-color: var(--dark-card);
  padding: 8px 15px;
  border-bottom: 1px solid var(--dark-border);
  font-size: 1em;
  color: var(--dark-text);
  text-align: right;
  flex-wrap: nowrap;
  overflow-x: auto;
  white-space: nowrap;
}

body.light-mode .welcome-bar {
  background-color: var(--light-card);
  border-bottom: 1px solid var(--light-border);
  color: var(--light-text);
}

.welcome-bar i {
  color: var(--turquoise);
  font-size: 1.2em;
}

.welcome-bar span {
  font-weight: 600;
}

.welcome-bar .info-item {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.welcome-bar .no-bots {
  color: var(--error-color);
  font-weight: bold;
}

/* Page Content Area */
.page-content {
  padding: 20px;
  flex-grow: 1;
  max-width: 100%;
  overflow-x: hidden;
}

/* Dashboard Cards Container */
.dashboard-cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

@media (min-width: 768px) {
  .dashboard-cards-container {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

/* Dashboard Card */
.dashboard-card {
  background: linear-gradient(135deg, var(--turquoise), #0a6157); /* WhatsApp green gradient */
  color: white;
  border-radius: 8px; /* Updated border-radius */
  padding: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s, background 0.3s;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.5s ease forwards;
  animation-delay: calc(var(--index) * 0.1s);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); /* Light shadow */
  cursor: pointer; /* إضافة مؤشر الزرار */
}

.dashboard-card:hover {
  transform: scale(1.05); /* Animation on hover */
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.3); /* WhatsApp green shadow */
  background: linear-gradient(135deg, #0a6157, var(--turquoise)); /* تدرج عكسي عند الهوفر */
}

.dashboard-card i {
  font-size: 2em;
  margin-bottom: 10px;
}

.dashboard-card h3 {
  font-size: 1.2em;
  margin: 0 0 10px;
}

.dashboard-card p {
  font-size: 0.9em;
  opacity: 0.9;
  margin: 0 0 15px;
}

.dashboard-card .btn {
  background: var(--dark-sidebar);
  color: var(--turquoise);
  padding: 8px 16px;
  font-size: 0.9em;
  border-radius: 8px; /* Match border-radius */
}

.dashboard-card .btn:hover {
  background: white;
  color: var(--turquoise);
}

/* ألوان مخصصة للأيقونات حسب المنصة */
.dashboard-card[data-page="facebook"] i {
  color: #1877F2; /* لون فيسبوك الأزرق */
}

.dashboard-card[data-page="instagram"] i {
  color: #E1306C; /* لون إنستجرام الوردي/الأحمر */
}

.dashboard-card[data-page="whatsapp"] i {
  color: #25D366; /* لون واتساب الأخضر */
}

.dashboard-card[data-page="bots"] i {
  color: #00C4B4; /* لون مميز للبوتات (نفس لون الـ turquoise) */
}

.dashboard-card[data-page="rules"] i {
  color: #FFD700; /* لون ذهبي للقواعد */
}

.dashboard-card[data-page="chat-page"] i {
  color: #1E90FF; /* لون أزرق فاتح لصفحة الدردشة */
}

.dashboard-card[data-page="messages"] i {
  color: #4682B4; /* لون أزرق داكن للرسائل */
}

.dashboard-card[data-page="feedback"] i {
  color: #FF4500; /* لون برتقالي للتقييمات */
}

.dashboard-card[data-page="wasenderpro"] i {
  color: #FF8C00; /* لون برتقالي غامق لـ Wasender Pro */
}

.dashboard-card[data-page="settings"] i {
  color: #6A5ACD; /* لون بنفسجي للإعدادات */
}

/* Tooltip for Cards */
.dashboard-card[data-tooltip]:hover:after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark-sidebar);
  color: var(--dark-text);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.9em;
  white-space: nowrap;
  z-index: 10;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  margin-bottom: 10px;
}

body.light-mode .dashboard-card[data-tooltip]:hover:after {
  background: var(--light-sidebar);
  color: var(--light-text);
}

/* Floating Back Button */
.floating-back-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--turquoise);
  color: white;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s, opacity 0.3s;
  z-index: 1200;
  opacity: 0;
  pointer-events: none;
}

.floating-back-btn.active {
  opacity: 1;
  pointer-events: auto;
}

.floating-back-btn:hover {
  transform: scale(1.1);
}

/* Fixed Footer */
.fixed-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: var(--footer-height);
  background: var(--dark-sidebar);
  border-top: 1px solid var(--dark-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px;
  z-index: 1000;
}

body.light-mode .fixed-footer {
  background: var(--light-sidebar);
  border-top-color: var(--light-border);
}

.fixed-footer .footer-btn {
  background: none;
  border: none;
  color: var(--dark-text);
  font-size: 1.2em;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: color 0.3s, transform 0.2s;
}

body.light-mode .fixed-footer .footer-btn {
  color: var(--light-text);
}

.fixed-footer .footer-btn:hover {
  color: var(--turquoise);
  transform: scale(1.1);
}

.fixed-footer .footer-btn span {
  font-size: 0.7em;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2em; /* Match footer button size */
  padding: 8px;
  transition: transform 0.2s;
}

.theme-toggle-btn .fa-sun {
  display: none;
  color: #f39c12;
}

.theme-toggle-btn .fa-moon {
  display: block;
  color: #bdc3c7;
}

body.light-mode .theme-toggle-btn .fa-sun {
  display: block;
}

body.light-mode .theme-toggle-btn .fa-moon {
  display: none;
}

.theme-toggle-btn:hover {
  transform: scale(1.1);
}

/* Modal for Full Notification Content */
.modal {
  display: flex;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  justify-content: center;
  align-items: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease-in-out;
}

.modal-content {
  background-color: var(--dark-card);
  border-radius: 12px;
  padding: 20px;
  max-width: 90vw;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease-in-out;
}

body.light-mode .modal-content {
  background-color: var(--light-card);
  box-shadow: 0 8px 20px var(--shadow-light);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.4em;
  color: var(--dark-text);
}

body.light-mode .modal-header h3 {
  color: var(--light-text);
}

.notification-content {
  margin-bottom: 15px;
}

.notification-content p {
  font-size: 1em;
  color: var(--dark-text);
}

body.light-mode .notification-content p {
  color: var(--light-text);
}

.notification-content small {
  display: block;
  margin-top: 10px;
  font-size: 0.8em;
  opacity: 0.7;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn-secondary {
  padding: 10px 20px;
  border: none;
  border-radius: 8px; /* Match border-radius */
  cursor: pointer;
  font-size: 1em;
  background-color: var(--dark-border);
  color: var(--dark-text);
  transition: background-color var(--transition-speed);
  min-width: 100px;
}

body.light-mode .btn-secondary {
  background-color: var(--light-border);
  color: var(--light-text);
}

.btn-secondary:hover {
  background-color: var(--turquoise);
  color: var(--dark-sidebar);
}

body.light-mode .btn-secondary:hover {
  background-color: #0a6157; /* Slightly darker WhatsApp green */
  color: var(--light-sidebar);
}

/* Animation Keyframes */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive Adjustments */
@media (max-width: 992px) {
  .page-content {
    padding-bottom: calc(var(--footer-height) + 20px);
  }
  .welcome-bar {
    font-size: 0.5em;
    padding: 4px 7.5px;
    gap: 4px;
  }
  .welcome-bar i {
    font-size: 0.6em;
  }
  .welcome-bar .info-item {
    gap: 4px;
  }
  .bot-selector-container {
    min-width: 100px;
  }
  .form-group.bot-selector label {
    font-size: 0.45em;
  }
  #botSelectDashboard {
    font-size: 0.5em;
    padding: 5px 17.5px 5px 7.5px;
    min-width: 90px;
  }
}

@media (min-width: 993px) {
  .fixed-footer {
    display: flex; /* Keep footer visible on desktop */
  }
}

@media (max-width: 768px) {
  .welcome-bar {
    font-size: 0.45em;
    padding: 3px 5px;
    gap: 3px;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .header-actions {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }
  .bot-selector-container {
    width: 100%;
  }
  #botSelectDashboard {
    width: 100%;
    min-width: 75px;
    font-size: 0.45em;
    padding: 4px 15px 4px 6px;
  }
  .modal-content {
    max-width: 95vw;
    padding: 15px;
  }
  .page-content {
    padding: 15px;
  }
  .dashboard-cards-container {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }
  .dashboard-card {
    padding: 12px;
  }
  .dashboard-card i {
    font-size: 1.8em;
  }
  .dashboard-card h3 {
    font-size: 1em;
  }
  .dashboard-card p {
    font-size: 0.8em;
  }
  .dashboard-card .btn {
    padding: 6px 12px;
    font-size: 0.8em;
  }
  .floating-back-btn {
    top: 15px;
    right: 15px;
    width: 35px;
    height: 35px;
  }
  .fixed-footer .footer-btn {
    font-size: 1em;
    padding: 6px;
  }
  .fixed-footer .footer-btn span {
    font-size: 0.65em;
  }
  .theme-toggle-btn {
    font-size: 1em;
  }
}

@media (max-width: 576px) {
  .main-header {
    padding: 0 10px;
  }
  .page-content {
    padding: 10px;
  }
  .dashboard-cards-container {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  .dashboard-card {
    padding: 10px;
  }
  .dashboard-card i {
    font-size: 1.6em;
  }
  .dashboard-card h3 {
    font-size: 0.9em;
  }
  .dashboard-card p {
    font-size: 0.75em;
  }
  .dashboard-card .btn {
    padding: 5px 10px;
    font-size: 0.75em;
  }
  .header-right {
    gap: 10px;
  }
  .welcome-bar {
    font-size: 0.425em;
    padding: 2.5px 4px;
    gap: 3px;
  }
  .welcome-bar .info-item {
    gap: 3px;
  }
  .modal-content {
    max-width: 98vw;
    padding: 10px;
  }
  .modal-header h3 {
    font-size: 1.2em;
  }
  .btn-secondary {
    padding: 8px 15px;
    font-size: 0.9em;
    min-width: 90px;
  }
  #botSelectDashboard {
    font-size: 0.425em;
    padding: 3px 12px 3px 5px;
    min-width: 70px;
  }
  .floating-back-btn {
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
  }
  .fixed-footer .footer-btn {
    font-size: 0.9em;
    padding: 5px;
  }
  .fixed-footer .footer-btn span {
    font-size: 0.6em;
  }
  .theme-toggle-btn {
    font-size: 0.9em;
  }
}

/* Overview Page Styles */
.overview-container {
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

.section-title {
  font-size: 2em;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  gap: 15px;
}

body.dark-mode .section-title {
  color: var(--dark-text);
}

body.light-mode .section-title {
  color: var(--light-text);
}

.section-title i {
  color: var(--turquoise);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  padding: 25px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

body.dark-mode .stat-card {
  background-color: var(--dark-card);
  border: 1px solid var(--dark-border);
}

body.light-mode .stat-card {
  background-color: var(--light-card);
  border: 1px solid var(--light-border);
  box-shadow: 0 2px 8px var(--shadow-light);
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 196, 180, 0.2);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--turquoise), #0a6157);
  color: white;
  font-size: 1.8em;
}

.stat-info {
  flex: 1;
}

.stat-info h3 {
  font-size: 1.1em;
  margin-bottom: 8px;
}

body.dark-mode .stat-info h3 {
  color: var(--dark-text);
}

body.light-mode .stat-info h3 {
  color: var(--light-text);
}

.stat-value {
  font-size: 2em;
  font-weight: bold;
  color: var(--turquoise);
  margin-bottom: 5px;
}

.stat-info small {
  font-size: 0.85em;
  opacity: 0.7;
}

body.dark-mode .stat-info small {
  color: var(--dark-text);
}

body.light-mode .stat-info small {
  color: var(--light-text);
}

.bot-status-card {
  padding: 30px;
  border-radius: 12px;
  margin-top: 20px;
}

body.dark-mode .bot-status-card {
  background-color: var(--dark-card);
  border: 1px solid var(--dark-border);
}

body.light-mode .bot-status-card {
  background-color: var(--light-card);
  border: 1px solid var(--light-border);
  box-shadow: 0 2px 8px var(--shadow-light);
}

.bot-status-card h3 {
  font-size: 1.5em;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

body.dark-mode .bot-status-card h3 {
  color: var(--dark-text);
}

body.light-mode .bot-status-card h3 {
  color: var(--light-text);
}

.bot-status-card h3 i {
  color: var(--turquoise);
}

.bot-status-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.status-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.status-label {
  font-size: 0.9em;
  opacity: 0.7;
}

body.dark-mode .status-label {
  color: var(--dark-text);
}

body.light-mode .status-label {
  color: var(--light-text);
}

.status-value {
  font-size: 1.2em;
  font-weight: bold;
}

body.dark-mode .status-value {
  color: var(--dark-text);
}

body.light-mode .status-value {
  color: var(--light-text);
}

/* Charts Section */
.charts-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 20px;
  margin: 30px 0;
}

.chart-card {
  padding: 25px;
  border-radius: 12px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

body.dark-mode .chart-card {
  background-color: var(--dark-card);
  border: 1px solid var(--dark-border);
}

body.light-mode .chart-card {
  background-color: var(--light-card);
  border: 1px solid var(--light-border);
  box-shadow: 0 2px 8px var(--shadow-light);
}

.chart-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 196, 180, 0.15);
}

.chart-card h3 {
  font-size: 1.2em;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

body.dark-mode .chart-card h3 {
  color: var(--dark-text);
}

body.light-mode .chart-card h3 {
  color: var(--light-text);
}

.chart-card h3 i {
  color: var(--turquoise);
}

.chart-card canvas {
  max-height: 300px;
}

.chart-card-full {
  padding: 25px;
  border-radius: 12px;
  margin: 20px 0;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

body.dark-mode .chart-card-full {
  background-color: var(--dark-card);
  border: 1px solid var(--dark-border);
}

body.light-mode .chart-card-full {
  background-color: var(--light-card);
  border: 1px solid var(--light-border);
  box-shadow: 0 2px 8px var(--shadow-light);
}

.chart-card-full:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 196, 180, 0.15);
}

.chart-card-full h3 {
  font-size: 1.2em;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

body.dark-mode .chart-card-full h3 {
  color: var(--dark-text);
}

body.light-mode .chart-card-full h3 {
  color: var(--light-text);
}

.chart-card-full h3 i {
  color: var(--turquoise);
}

.chart-card-full canvas {
  max-height: 400px;
}

/* Mobile Responsive for Sidebar */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(100%);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
  }

  .sidebar-toggle {
    display: none;
  }

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

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

  .sidebar.collapsed ~ .main-content {
    margin-right: 0;
  }

  .mobile-menu-btn {
    display: block;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .bot-status-info {
    grid-template-columns: 1fr;
  }

  .overview-container {
    padding: 15px;
  }

  .section-title {
    font-size: 1.5em;
  }

  .charts-section {
    grid-template-columns: 1fr;
  }

  .chart-card canvas {
    max-height: 250px;
  }

  .chart-card-full canvas {
    max-height: 300px;
  }
}

@media (max-width: 360px) {
  .page-content {
    padding: 8px;
  }
  .dashboard-cards-container {
    gap: 8px;
  }
  .dashboard-card {
    padding: 8px;
  }
  .dashboard-card i {
    font-size: 1.4em;
  }
  .dashboard-card h3 {
    font-size: 0.85em;
  }
  .dashboard-card p {
    font-size: 0.7em;
  }
  .dashboard-card .btn {
    padding: 4px 8px;
    font-size: 0.7em;
  }
  .welcome-bar {
    font-size: 0.4em;
  }
  #botSelectDashboard {
    font-size: 0.4em;
    padding: 2.5px 10px 2.5px 4px;
    min-width: 65px;
  }
  .modal-content {
    padding: 8px;
  }
  .modal-header h3 {
    font-size: 1.1em;
  }
  .floating-back-btn {
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
  }
  .fixed-footer .footer-btn {
    font-size: 0.8em;
    padding: 4px;
  }
  .fixed-footer .footer-btn span {
    font-size: 0.55em;
  }
  .theme-toggle-btn {
    font-size: 0.8em;
  }
}
}

/* Specific styles for the reports navigation used in `reports.js` */
.reports-nav .btn {
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,0.04);
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.reports-nav .btn:hover {
  filter: brightness(0.98);
}

.reports-nav .btn.active,
.reports-nav .btn[aria-pressed="true"],
.reports-nav .btn[aria-selected="true"] {
  background: var(--turquoise) !important;
  color: #ffffff !important;
  border-color: var(--turquoise) !important;
  box-shadow: 0 6px 18px rgba(10,97,87,0.18);
}

.reports-nav .btn:focus {
  outline: 3px solid rgba(0,196,180,0.12);
  outline-offset: 2px;
}

/* Date inputs in reports controls (From / To) */
#reportControls input[type="date"],
#reportControls .form-group input[type="date"] {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  color: inherit;
  font-size: 14px;
  inline-size: 140px; /* narrow inputs like the mockup */
  text-align: right; /* RTL alignment */
  -webkit-appearance: none;
  appearance: none;
}

#reportControls input[type="date"]::-webkit-datetime-edit-fields-wrapper { direction: rtl; }

#reportControls input[type="date"]:focus {
  box-shadow: 0 6px 18px rgba(10,97,87,0.12);
  border-color: var(--turquoise);
  outline: none;
}

/* Ensure labels and form-group spacing look consistent in the reports panel */
#reportControls .form-group { margin-block-end: 10px; }
#reportControls .form-group label { display:block; margin-block-end:6px; font-weight:600; color: inherit; }

/* remove background applied directly to the internal date fields (fixes duplicated icons in some browsers) */
#reportControls input[type="date"] { background-image: none !important; }

/* Use an explicit .date-icon element placed next to the input for full control and cross-browser stability */
#reportControls .form-group { position: relative; }
#reportControls .form-group input[type="date"] { padding-right: 100px; min-inline-size: 220px; inline-size: 260px; height: 44px; box-sizing: border-box; font-size:20px; }
#reportControls .form-group .date-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: auto;
  cursor: pointer;
}

/* stronger hide for native picker indicator in WebKit/Blink */
#reportControls input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0 !important;
  pointer-events: none !important;
  display: block !important;
  width: 0 !important;
  height: 0 !important;
}

/* Light theme: black calendar icon */
#reportControls .form-group .date-icon,
.light-mode #reportControls .form-group .date-icon {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23000' d='M7 10h10v8H7zM7 4h1V2h2v2h6V2h2v2h1a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1z'/></svg>");
}

/* Dark theme: white calendar icon */
.dark-mode #reportControls .form-group .date-icon,
.dashboard-page.dark-mode #reportControls .form-group .date-icon {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23fff' d='M7 10h10v8H7zM7 4h1V2h2v2h6V2h2v2h1a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1z'/></svg>");
}

/* Hide native indicator in WebKit to avoid duplicate controls where supported */
#reportControls input[type="date"]::-webkit-calendar-picker-indicator { opacity: 0; }

/* Keep From/To on a single row inside the controls and present in RTL visual order */
#reportControls .form-grid-three { display:flex; gap:12px; align-items:center; flex-wrap:wrap; direction:rtl; }




