/*
 * Storm Breaker Panel - CSS
 * نظام الألوان الأساسي والتخطيط الرئيسي
 */

/* متغيرات CSS */
:root {
  /* الألوان الأساسية */
  --primary-color: #3d5afe;
  --primary-dark: #304ffe;
  --primary-light: #536dfe;
  
  /* ألوان الخلفية */
  --bg-dark: #121212;
  --bg-medium: #1e1e1e;
  --bg-light: #252525;
  
  /* ألوان النص */
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.85);
  --text-muted: rgba(255, 255, 255, 0.65);
  
  /* ألوان الحالة */
  --success: #4caf50;
  --warning: #ff9800;
  --danger: #f44336;
  --info: #2196f3;
  
  /* الأبعاد */
  --sidebar-width: 280px;
  --sidebar-collapsed: 80px;
  --header-height: 70px;
  --border-radius: 8px;
  
  /* أزمنة الانتقال */
  --transition-speed: 0.3s;
}

/* الوضع الفاتح */
:root.light-mode, body.light-mode {
  --bg-dark: #f8f9fa;
  --bg-medium: #ffffff;
  --bg-light: #f1f3f5;
  --text-primary: #212529;
  --text-secondary: #495057;
  --text-muted: #6c757d;
  --primary-color: #4361ee;
  --primary-dark: #3a56e8;
  --primary-light: #5a78ff;
  
  /* ألوان الحالة للوضع الفاتح */
  --success: #2e8540;
  --warning: #e67700;
  --danger: #d9534f;
  --info: #0275d8;
}

/* إعادة تعيين عامة */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Tajawal', sans-serif;
}

body {
  font-family: 'Tajawal', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  direction: rtl;
  overflow-x: hidden;
  display: flex;
  min-height: 100vh;
  position: relative;
  opacity: 0;
  transition: opacity 0.5s ease;
  line-height: 1.5;
}

/* القائمة الجانبية */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-medium);
  height: 100vh;
  position: fixed;
  top: 0;
  right: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  justify-content: space-between;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  height: var(--header-height);
}

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

.logo-icon {
  width: 32px;
  height: 32px;
  fill: var(--primary-color);
}

.logo h2 {
  font-size: 1.5rem;
  margin: 0;
  font-weight: 700;
  color: var(--text-primary);
}

.logo span {
  color: var(--primary-color);
  font-weight: 700;
}

.menu-toggle {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
}

.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: visible;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-item {
  margin-bottom: 0.25rem;
}

.nav-item a {
  display: flex;
  align-items: center;
  padding: 0.875rem 1.5rem;
  text-decoration: none;
  color: var(--text-secondary);
  transition: all var(--transition-speed);
  border-right: 3px solid transparent;
  font-weight: 500;
  min-height: 56px;
  position: relative;
}

.nav-item a:hover,
.nav-item.active a {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  border-right-color: var(--primary-color);
}

.nav-item.active a::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 3px;
  background-color: var(--primary-color);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--transition-speed);
}

.nav-item.active a:hover::after {
  transform: scaleX(0);
}

.nav-item i {
  font-size: 1.35rem;
  margin-left: 1rem;
  min-width: 1.5rem;
  text-align: center;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: auto;
}

.user-info {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.user-avatar {
  width: 40px;
  height: 40px;
  background-color: var(--bg-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.75rem;
}

.user-avatar i {
  font-size: 1.5rem;
}

.user-details h4 {
  font-size: 1rem;
  margin: 0 0 0.25rem 0;
}

.user-details span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.logout-btn {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--text-secondary);
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius);
  transition: all var(--transition-speed);
  justify-content: center;
}

.logout-btn:hover {
  background-color: rgba(244, 67, 54, 0.1);
  color: var(--danger);
}

.logout-btn i {
  margin-left: 0.5rem;
}

/* المحتوى الرئيسي */
.main-content {
  flex: 1;
  padding: 1.5rem;
  margin-right: var(--sidebar-width);
  min-height: 100vh;
  width: calc(100% - var(--sidebar-width));
}

/* شريط التنقل العلوي */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.5rem;
  height: 70px;
  background-color: var(--bg-medium);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-left, .nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-right button, .nav-left button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--text-secondary);
  transition: all var(--transition-speed);
  cursor: pointer;
}

.nav-right button:hover, .nav-left button:hover {
  color: var(--primary-color);
  box-shadow: none;
}

.search-container {
  position: relative;
  width: 350px;
  margin-left: 1rem;
}

.search-input {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  background-color: var(--bg-light);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  font-size: 0.9375rem;
  transition: all var(--transition-speed);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(61, 90, 254, 0.2);
}

.search-container i {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.25rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-actions .theme-toggle,
.nav-actions .notification-btn,
.nav-actions .menu-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--bg-light);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--text-secondary);
  transition: all var(--transition-speed);
  cursor: pointer;
}

.nav-actions .theme-toggle:hover,
.nav-actions .notification-btn:hover,
.nav-actions .menu-toggle:hover {
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 0 15px rgba(61, 90, 254, 0.15);
}

.version-info {
  font-size: 0.875rem;
  color: var(--text-muted);
  background-color: var(--bg-light);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* لوحة التحكم */
.panel-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.page-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.page-header p {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-weight: 400;
}

/* بطاقات الإحصاءات */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stats-card {
  background-color: var(--bg-medium);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
}

.stats-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.stats-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.stats-card:hover::before {
  transform: translateX(100%);
}

.stats-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: transform var(--transition-speed);
}

.stats-card:hover .stats-icon {
  transform: scale(1.1);
}

.stats-card h3 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  color: white;
}

.stats-info p {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.875rem;
}

/* شبكة البطاقات */
.card-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.card {
  background-color: var(--bg-medium);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background-color: var(--bg-medium);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-header h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.card-actions {
  display: flex;
  gap: 0.5rem;
}

.card-body {
  padding: 1.5rem;
  min-height: 100px;
}

.card-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* وحدة التحكم بالنشاط */
.activity-console {
  width: 100%;
  min-height: 300px;
  background-color: var(--bg-light);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--border-radius);
  padding: 1rem;
  font-family: 'Courier New', monospace;
  resize: none;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* قائمة الاتصالات */
.connection-item {
  display: flex;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: background-color var(--transition-speed);
}

.connection-item:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.connection-item:last-child {
  border-bottom: none;
}

.connection-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 1rem;
  font-size: 1.25rem;
  color: var(--text-secondary);
}

.connection-details {
  flex: 1;
}

.connection-details h4 {
  margin: 0 0 0.25rem 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

.connection-details p {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.connection-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 1rem;
  box-shadow: 0 0 5px currentColor;
}

.connection-status.active {
  background-color: var(--success);
}

.connection-status.inactive {
  background-color: var(--text-muted);
}

/* قسم القوالب */
.templates-container {
  margin-top: 1rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 1.25rem;
}

/* لوحة الإشعارات */
.notification-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  height: 100vh;
  background-color: var(--bg-medium);
  z-index: 200;
  transform: translateX(-100%);
  transition: transform var(--transition-speed);
  display: flex;
  flex-direction: column;
  box-shadow: 5px 0 25px rgba(0, 0, 0, 0.3);
}

.notification-open .notification-panel {
  transform: translateX(0);
}

.notification-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.notification-header h3 {
  margin: 0;
  font-size: 1.25rem;
}

.close-panel {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.25rem;
  cursor: pointer;
}

.notification-list {
  flex: 1;
  overflow-y: auto;
}

.notification-item {
  display: flex;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.notification-item.new {
  background-color: rgba(33, 150, 243, 0.05);
}

.notification-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.75rem;
  font-size: 1.125rem;
}

.notification-icon.success {
  background-color: rgba(76, 175, 80, 0.15);
  color: var(--success);
}

.notification-icon.warning {
  background-color: rgba(255, 152, 0, 0.15);
  color: var(--warning);
}

.notification-icon.info {
  background-color: rgba(33, 150, 243, 0.15);
  color: var(--info);
}

.notification-content h4 {
  margin: 0 0 0.25rem 0;
  font-size: 0.9375rem;
  font-weight: 600;
}

.notification-content p {
  margin: 0 0 0.25rem 0;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.notification-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.notification-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: center;
}

.notification-footer .btn {
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
  font-weight: 600;
}

/* خلفية شفافة */
.backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-speed), visibility var(--transition-speed);
}

body.sidebar-open .backdrop,
body.notification-open .backdrop {
  opacity: 1;
  visibility: visible;
}

/* الأزرار */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--border-radius);
  background-color: var(--bg-light);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-speed);
  font-family: 'Tajawal', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  gap: 0.5rem;
  min-height: 40px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  letter-spacing: 0.01em;
  text-align: center;
}

.btn i {
  font-size: 1.125rem;
  margin-left: 0.25rem;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
  border: none;
}

.btn-primary:hover {
  background-color: rgba(var(--primary-rgb), 0.9);
}

.btn-secondary {
  background-color: var(--bg-light);
  color: var(--text-secondary);
  font-weight: 500;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover {
  background-color: #353535;
  color: var(--text-primary);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-secondary);
  font-weight: 500;
  box-shadow: none;
}

.btn-outline:hover {
  background-color: var(--bg-light);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.btn-outline-primary {
  background-color: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

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

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  min-height: 32px;
}

.btn:active {
  transform: scale(0.97);
}

/* زر الاستماع */
.listen-btn {
  position: relative;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #2E3137;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.5;
  border-radius: var(--border-radius);
}

.listen-btn i {
  font-size: 1.125rem;
}

.listen-btn.active {
  background: linear-gradient(90deg, rgba(76, 175, 80, 0.25) 0%, rgba(76, 175, 80, 0.1) 100%);
  border-color: rgba(76, 175, 80, 0.5);
  color: #4CAF50;
  font-weight: 600;
}

.listen-btn span {
  line-height: 1;
  white-space: nowrap;
}

/* تحسينات على زري المسح والتنزيل */
.clear-btn, .download-btn {
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: var(--border-radius);
  font-weight: 500;
  transition: all var(--transition-speed);
}

.clear-btn {
  background-color: rgba(244, 67, 54, 0.15);
  color: #F44336;
  border: 1px solid rgba(244, 67, 54, 0.3);
}

.clear-btn:hover {
  background-color: rgba(244, 67, 54, 0.25);
  box-shadow: 0 0 15px rgba(244, 67, 54, 0.2);
}

.download-btn {
  background-color: rgba(33, 150, 243, 0.15);
  color: #2196F3;
  border: 1px solid rgba(33, 150, 243, 0.3);
}

.download-btn:hover {
  background-color: rgba(33, 150, 243, 0.25);
  box-shadow: 0 0 15px rgba(33, 150, 243, 0.2);
}

.dropdown-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color var(--transition-speed);
}

.dropdown-btn:hover {
  background-color: var(--bg-light);
  color: var(--text-primary);
}

/* تأثيرات تفاعلية للأزرار */
.btn:active, .btn:focus {
  box-shadow: 0 0 0 3px rgba(61, 90, 254, 0.4);
  transform: scale(0.97);
  transition: box-shadow 0.1s ease-in-out, transform 0.1s ease;
}

.btn-outline:active, .btn-outline:focus {
  background-color: var(--bg-light);
  color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(61, 90, 254, 0.4);
  border-color: var(--primary-color);
}

/* تأثير خاص لزر "عرض الكل" */
.connections-card .card-footer .btn-outline {
  border-color: rgba(255, 255, 255, 0.2);
  transition: all 0.2s ease;
}

.connections-card .card-footer .btn-outline:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.connections-card .card-footer .btn-outline:active,
.connections-card .card-footer .btn-outline:focus {
  background-color: rgba(61, 90, 254, 0.08);
  box-shadow: 0 0 0 3px rgba(61, 90, 254, 0.4), 0 4px 10px rgba(61, 90, 254, 0.3);
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: scale(0.97);
}

/* تحسين استجابية الأزرار للمس */
@media (hover: none) and (pointer: coarse) {
  * {
    font-family: 'Tajawal', sans-serif !important;
  }
  
  body, .btn, button, a, input, textarea, select {
    font-family: 'Tajawal', sans-serif !important;
  }
  
  .btn {
    transition: all 0.2s ease;
  }
  
  .btn:active {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 0 0 3px rgba(61, 90, 254, 0.4);
  }
  
  .btn-outline:active {
    background-color: rgba(61, 90, 254, 0.08);
    color: var(--primary-color);
    border-color: var(--primary-color);
  }
}

/* تحسينات على شريط البحث */
.search-container {
  position: relative;
  width: 350px;
}

.search-input {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  background-color: var(--bg-light);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  font-size: 0.9375rem;
  transition: all var(--transition-speed);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(61, 90, 254, 0.2);
}

.search-container i {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.25rem;
}

/* تحسينات إضافية على البطاقات */
.card-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* تحسينات على لوحة النشاط */
.activity-card .card-header {
  background: var(--bg-medium);
}

.activity-card .activity-console {
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  color: var(--text-primary);
  background-color: var(--bg-light);
  border: 1px solid rgba(255, 255, 255, 0.08);
  line-height: 1.5;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* تحسينات على بطاقات الإحصائيات */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stats-card h3 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  color: white;
}

/* تحسينات على أزرار التنزيل والمسح */
.btn-primary#btn-download {
  background: linear-gradient(to bottom, var(--primary-color), var(--primary-dark));
  box-shadow: 0 4px 15px rgba(61, 90, 254, 0.2);
}

.btn-secondary#btn-clear {
  background-color: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* تحسينات على قسم القوالب */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.template-item {
  background-color: var(--bg-medium);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  transition: all var(--transition-speed);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.template-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  background: linear-gradient(135deg, var(--bg-medium) 0%, rgba(45, 45, 55, 1) 100%);
  border-color: var(--primary-color);
}

.template-item:active, .template-item:focus, .template-item:focus-visible {
  outline: none;
  border-color: transparent;
}

.template-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: auto;
}

.template-actions .btn-sm:first-child {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

.template-actions .btn-sm:last-child {
  background: linear-gradient(to bottom, var(--primary-color), var(--primary-dark));
  color: white;
  font-weight: 600;
}

/* الرسوم المتحركة للأزرار */
@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.7;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes borderPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
  }
}

.listen-btn.active {
  animation: borderPulse 2s infinite;
  box-shadow: 0 0 15px rgba(76, 175, 80, 0.25);
}

.listen-btn.active i {
  animation: pulse 1.5s infinite ease-in-out;
  color: #4CAF50;
}

/* أزرار التنزيل والمسح */
.card-footer .btn {
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
}

.card-footer .btn i {
  font-size: 1.125rem;
}

.card-footer .btn-primary {
  font-weight: 600;
}

/* أزرار معاينة القوالب */
.template-actions .btn {
  font-size: 0.75rem;
  padding: 0.375rem 0.75rem;
  min-height: 32px;
}

/* زر القائمة المنسدلة */
.dropdown-btn {
  width: 38px;
  height: 38px;
  font-size: 1.125rem;
}

/* تحسينات على الشاشات الكبيرة */
@media (min-width: 1400px) {
  .main-content {
    max-width: 1400px;
    margin-right: var(--sidebar-width);
    margin-left: auto;
    padding: 2rem;
  }
}

/* تنسيقات أيقونات الإحصائيات */
.stats-icon.active {
  background-color: rgba(76, 175, 80, 0.15);
  color: var(--success);
}

.stats-icon.targets {
  background-color: rgba(244, 67, 54, 0.15);
  color: #f44336;
}

.stats-icon.data {
  background-color: rgba(33, 150, 243, 0.15);
  color: var(--info);
}

.stats-icon.alerts {
  background-color: rgba(255, 152, 0, 0.15);
  color: var(--warning);
}

.stats-info h3 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  color: white;
}

/* إضافة تأثيرات للمزيد من التناغم */
.activity-card {
  z-index: 1;
}

.connections-card {
  z-index: 1;
}

.btn i.bx-dots-vertical-rounded {
  font-size: 1.5rem;
}

/* تحسينات على شريط البحث */
.search-container {
  position: relative;
  width: 350px;
}

.search-input {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  background-color: var(--bg-light);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  font-size: 0.9375rem;
  transition: all var(--transition-speed);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(61, 90, 254, 0.2);
}

.search-container i {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.25rem;
}

/* تحسينات إضافية على البطاقات */
.card-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* تحسينات على لوحة النشاط */
.activity-card .card-header {
  background: var(--bg-medium);
}

.activity-card .activity-console {
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  color: var(--text-primary);
  background-color: var(--bg-light);
  border: 1px solid rgba(255, 255, 255, 0.08);
  line-height: 1.5;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* تحسينات على بطاقات الإحصائيات */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stats-card h3 {
  font-size: 2rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  color: white;
}

/* تحسينات على أزرار التنزيل والمسح */
.btn-primary#btn-download {
  background: linear-gradient(to bottom, var(--primary-color), var(--primary-dark));
  box-shadow: 0 4px 15px rgba(61, 90, 254, 0.2);
}

.btn-secondary#btn-clear {
  background-color: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* تحسينات على قسم القوالب */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.template-item {
  background-color: var(--bg-medium);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  transition: all var(--transition-speed);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.template-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  background: linear-gradient(135deg, var(--bg-medium) 0%, rgba(45, 45, 55, 1) 100%);
  border-color: var(--primary-color);
}

.template-header {
  margin-bottom: 0.75rem;
}

.template-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.template-item p {
  color: var(--text-muted);
  margin: 0 0 1.5rem 0;
  font-size: 0.875rem;
  flex: 1;
}

.template-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: auto;
}

/* تنسيقات خاصة بكل نوع من القوالب */
.audio-template {
  border-top: 3px solid #9c27b0;
}

.camera-template {
  border-top: 3px solid #2196f3;
}

.location-template {
  border-top: 3px solid #4caf50;
}

/* تحسين مظهر الأزرار */
.template-item .btn-outline {
  background-color: transparent;
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.template-item .btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.25);
}

.template-item .btn-primary {
  background-color: var(--primary-color);
  color: white;
  border: none;
}

.template-item .btn-primary:hover {
  background-color: var(--primary-dark);
}

/* تصميم متجاوب */
@media (max-width: 1200px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 992px) {
  .sidebar {
    transform: translateX(100%);
    transition: transform var(--transition-speed);
    width: 280px;
    max-width: 80%;
  }
  
  body.sidebar-open .sidebar {
    transform: translateX(0);
  }
  
  .main-content {
    margin-right: 0;
    width: 100%;
  }
  
  .menu-toggle {
    background-color: var(--bg-light);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-speed);
  }
  
  .menu-toggle:hover, .menu-toggle:active {
    background-color: var(--primary-color);
    color: white;
  }
}

@media (max-width: 768px) {
  .stats-container {
    grid-template-columns: 1fr;
  }
  
  .top-nav {
    padding: 0.75rem;
  }
  
  .nav-left, .nav-right {
    gap: 0.5rem;
  }
  
  .search-container {
    width: 100%;
    max-width: 250px;
    margin-left: 0.5rem;
  }
  
  .notification-panel {
    width: 100%;
  }
  
  /* تحسين استجابة الأزرار على الأجهزة المحمولة */
  .btn {
    min-height: 44px; /* زيادة مساحة اللمس */
  }
  
  .connections-card .card-footer .btn-outline:active,
  .connections-card .card-footer .btn-outline:focus {
    background-color: rgba(61, 90, 254, 0.15);
    box-shadow: 0 0 0 4px rgba(61, 90, 254, 0.4), 0 4px 10px rgba(61, 90, 254, 0.3);
  }
}

/* تحديد شكل السكرول بار */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background-color: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background-color: var(--bg-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--primary-light);
}

/* تحسينات للقوائم المنسدلة */
.dropdown-menu {
  background-color: var(--bg-medium);
  border-radius: var(--border-radius);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 0.5rem 0;
  min-width: 150px;
  position: absolute;
  z-index: 1000;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  visibility: hidden;
}

.dropdown-menu.show {
  opacity: 1;
  transform: translateY(0);
  visibility: visible;
}

.dropdown-item {
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  color: var(--text-secondary);
  transition: all var(--transition-speed);
  text-decoration: none;
}

.dropdown-item:hover {
  background-color: var(--bg-light);
  color: var(--text-primary);
}

.dropdown-item:active, .dropdown-item:focus {
  background-color: rgba(61, 90, 254, 0.1);
  color: var(--primary-color);
  box-shadow: inset 0 0 0 1px var(--primary-color);
}

.dropdown-item i {
  margin-left: 0.5rem;
  font-size: 1.25rem;
}

/* تحسينات إضافية لعناصر البطاقات */
.template-item h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
}

.template-item p {
  color: var(--text-muted);
  margin: 0 0 1.5rem 0;
  font-size: 0.875rem;
}

/* تأثير التوهج عند لمس الزر */
.btn:focus-visible {
  outline: none;
  box-shadow: none;
}

/* تنسيقات قسم التطبيقات */
.apps-container {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.app-item {
  background: var(--bg-medium);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  transition: all var(--transition-speed);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.app-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  background: linear-gradient(135deg, rgba(30, 30, 40, 1) 0%, rgba(45, 45, 55, 1) 100%);
}

.app-item h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
}

.app-item p {
  color: var(--text-muted);
  margin: 0 0 1.5rem 0;
  font-size: 0.875rem;
}

/* تغيير "إضافة قالب" إلى "عرض الكل" */
.section-header .btn {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
}

.section-header .btn i {
  margin-left: 0.5rem;
  font-size: 1.125rem;
}

/* جعل كلمة متصل بلون أخضر */
.user-details span {
  font-size: 0.85rem;
  color: var(--success);
  font-weight: 500;
}

/* أنماط زر مسح البيانات الأحمر */
.btn-danger {
  background-color: #f44336;
  color: white;
  border: none;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(244, 67, 54, 0.3);
}

.btn-danger:hover {
  background-color: #e53935;
  box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
  transform: translateY(-2px);
}

.btn-danger:active, .btn-danger:focus {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(244, 67, 54, 0.3), 0 0 0 3px rgba(244, 67, 54, 0.2);
  background-color: #d32f2f;
}

/* أنماط زر مسح السجلات البرتقالي */
.btn-warning {
  background-color: #ff9800;
  color: white;
  border: none;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(255, 152, 0, 0.3);
}

.btn-warning:hover {
  background-color: #f57c00;
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
  transform: translateY(-2px);
}

.btn-warning:active, .btn-warning:focus {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(255, 152, 0, 0.3), 0 0 0 3px rgba(255, 152, 0, 0.2);
  background-color: #ef6c00;
}

/* تنسيقات القوالب والتطبيقات */
.templates-container {
    margin-bottom: 2rem;
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.25rem;
}

.template-item {
    background-color: var(--bg-medium);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: all var(--transition-speed);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.template-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    background: linear-gradient(135deg, var(--bg-medium) 0%, rgba(45, 45, 55, 1) 100%);
}

.template-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.template-icon i {
    font-size: 1.75rem;
}

.app-icon {
    background: linear-gradient(135deg, var(--primary-color), #8149e0);
    color: white;
}

.template-info {
    flex: 1;
}

.template-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.template-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.25rem;
}

.template-stat {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.use-template {
    align-self: flex-end;
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    vertical-align: middle;
    margin-right: 0.5rem;
}

.bg-primary {
    background-color: var(--primary-color);
    color: white;
}

.bg-success {
    background-color: #28a745;
    color: white;
}

/* تحسينات أزرار عرض الكل */
.section-header .btn-sm, .card-footer .btn-sm {
    padding: 0.25rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-secondary);
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.section-header .btn-sm:hover, .card-footer .btn-sm:hover {
    transform: translateX(-5px);
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

/* تأكيد حجم ومظهر كل أزرار btn-sm */
.btn-sm {
    font-size: 0.75rem;
    border-radius: var(--border-radius);
    font-weight: 600;
}

/* تنسيقات الروابط الخارجية */
a {
    text-decoration: none;
}

.mt-4 {
    margin-top: 2rem;
}

.notification-indicator {
  position: absolute;
  top: 5px;
  right: 8px;
  width: 7px;
  height: 7px;
  background-color: var(--danger);
  border-radius: 50%;
}

.nav-actions .notification-btn {
  position: relative;
}

/* أنماط الشاشات الكبيرة (الكمبيوتر) */
@media (min-width: 992px) {
  .top-nav {
    border-radius: 18px;
    margin: 8px;
    padding: 0.5rem 1.5rem;
    width: calc(100% - 16px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    background-color: rgba(30, 30, 30, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 15px;
  }
  
  .search-container {
    position: relative;
    width: 350px;
  }
  
  .nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }
  
  .nav-actions .theme-toggle,
  .nav-actions .notification-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--text-secondary);
    transition: all var(--transition-speed);
    cursor: pointer;
    position: relative;
  }
  
  .nav-actions .theme-toggle:hover,
  .nav-actions .notification-btn:hover {
    color: var(--primary-color);
    box-shadow: none;
  }
  
  /* إخفاء أزرار القائمة الجانبية للشاشات الكبيرة */
  .sidebar-header .menu-toggle {
    display: none;
  }
}

/* أنماط الشاشات الصغيرة (الأجهزة المحمولة) */
@media (max-width: 991px) {
  .nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }
  
  .search-container {
    position: relative;
    width: 100%;
    max-width: 250px;
    margin-left: 0.5rem;
  }
  
  .nav-right button, .nav-left button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--text-secondary);
    transition: all var(--transition-speed);
    cursor: pointer;
  }
  
  .nav-right button:hover, .nav-left button:hover {
    background-color: transparent;
    color: var(--primary-color);
    box-shadow: none;
  }
  
  /* إخفاء أزرار القائمة الجانبية من داخل السايدبار */
  .sidebar-header .menu-toggle {
    display: none;
  }
  
  .version-info {
    font-size: 0.875rem;
    color: var(--text-muted);
    background-color: var(--bg-light);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

.pc-only {
  display: flex;
}

.mobile-only {
  display: none;
}

@media (max-width: 991px) {
  .pc-only {
    display: none;
  }
  
  .mobile-only {
    display: flex;
  }
}

.nav-right .notification-btn {
  position: relative;
}

.mobile-only .notification-indicator {
  position: absolute;
  top: 5px;
  right: 8px;
  width: 7px;
  height: 7px;
  background-color: var(--danger);
  border-radius: 50%;
}

@media (max-width: 991px) {
  .top-nav {
    border-radius: 18px;
    margin: 8px;
    padding: 0.5rem 1rem;
    width: calc(100% - 16px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: opacity 0.3s ease, visibility 0.3s ease;
    position: sticky;
    top: 15px;
    background-color: rgba(30, 30, 30, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
  }
  
  body.sidebar-open .top-nav {
    opacity: 0;
    visibility: hidden;
  }
} 