/* 
 * Main CSS file for MediaPlus application
 * Created as part of the modernization project
 */

 :root {
  --primary-color: #2563eb;
  --secondary-color: #1e40af;
  --success-color: #16a34a;
  --info-color: #0891b2;
  --warning-color: #d97706;
  --danger-color: #dc2626;
  --light-color: #f9fafb;
  --dark-color: #1f2937;
  --body-bg: #f8f9fa;
  --sidebar-width: 250px;
  --header-height: 60px;
  --sidebar-bg: #1e293b;
  --sidebar-text: #f8fafc;
  --transition-speed: 0.3s;
}

/* Base Styles */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--body-bg);
  overflow-x: hidden;
  color: #333;
}
@font-face {
    font-family: 'Cairo';
    src: url('/fonts/Cairo/Cairo-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Cairo';
    src: url('/fonts/Cairo/Cairo-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Cairo';
    src: url('/fonts/Cairo/Cairo-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
}

body {
    font-family: 'Cairo', sans-serif;
}
/* Header Styles */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  z-index: 1030;
}

.navbar {
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  padding: 0 1rem;
  height: var(--header-height);
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

/* Sidebar Styles */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height));
  background-color: var(--sidebar-bg);
  overflow-y: auto;
  transition: all var(--transition-speed);
  z-index: 1020;
  padding: 1rem 0;
}

.sidebar-sticky {
  padding: 0 0.5rem;
}

/* Hide scrollbar while keeping functionality */
.sidebar::-webkit-scrollbar {
  width: 5px;
}

.sidebar::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 5px;
}

.sidebar::-webkit-scrollbar-track {
  background-color: transparent;
}

/* Sidebar Navigation */
.sidebar .nav-item {
  margin-bottom: 0.25rem;
}

.sidebar .nav-link {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: rgba(255, 255, 255, 0.7);
  border-radius: 0.375rem;
  transition: all var(--transition-speed);
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link i {
  margin-right: 0.75rem;
  width: 1.25rem;
  text-align: center;
}

/* Sidebar Submenu */
.sidebar .sub-menu {
  padding-left: 2.5rem;
  margin-top: 0.25rem;
}

.sidebar .sub-menu .nav-link {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* User Panel */
.user-panel {
  display: flex;
  align-items: center;
  padding: 1rem;
  margin-bottom: 1rem;
}

.user-panel .image {
  margin-right: 0.75rem;
}

.user-panel img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.user-panel .info {
  flex: 1;
}

.user-panel .username {
  color: #fff;
  font-weight: 600;
  margin-bottom: 0.125rem;
}

.user-panel .role {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  padding: 20px;
  transition: margin var(--transition-speed);
  width: calc(100% - var(--sidebar-width));
}

/* Responsive */
@media (max-width: 991.98px) {
  .sidebar {
      left: -100%;
  }
  
  .sidebar.show {
      left: 0;
  }
  
  .main-content {
      margin-left: 0;
      width: 100%;
  }
}

/* Content Header */
.content-header {
  margin-bottom: 1.5rem;
}

/* Cards */
.card {
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  margin-bottom: 1.5rem;
}

.card-header {
  background-color: transparent;
  border-bottom: 1px solid rgba(0, 0, 0, 0.125);
  padding: 1rem 1.25rem;
}

.card-title {
  font-weight: 600;
  margin-bottom: 0;
}

/* User Profile Dropdown */
.user-dropdown {
  width: 280px;
  padding: 0;
}

.user-header {
  background-color: var(--primary-color);
  color: #fff;
  padding: 1rem;
  text-align: center;
}

.user-header img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.5);
  margin-bottom: 0.5rem;
}

.user-footer {
  padding: 0.75rem 1rem;
  background-color: #f8f9fa;
  border-top: 1px solid rgba(0, 0, 0, 0.125);
}

/* Notification Dropdown */
.notification-dropdown {
  width: 320px;
  max-height: 400px;
  overflow-y: auto;
}

.notification-item {
  display: flex;
  align-items: center;
  padding: 0.25rem;
}

.notification-item .icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.75rem;
}

.notification-item .content {
  flex: 1;
}

.notification-item .message {
  margin-bottom: 0.125rem;
  font-size: 0.875rem;
}

.notification-item .time {
  color: #6c757d;
  font-size: 0.75rem;
  margin-bottom: 0;
}

/* Footer */
.footer {
  background-color: #fff;
  box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.05);
}

/* DataTables Customization */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
  padding: 0.375rem 0.75rem;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  margin-top: 1rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: 0.25rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff !important;
}

/* RTL Support */
[dir="rtl"] .sidebar .nav-link i {
  margin-right: 0;
  margin-left: 0.75rem;
}

[dir="rtl"] .user-panel .image {
  margin-right: 0;
  margin-left: 0.75rem;
}

[dir="rtl"] .notification-item .icon {
  margin-right: 0;
  margin-left: 0.75rem;
}

[dir="rtl"] .sidebar {
  left: auto;
  right: 0;
}

[dir="rtl"] .main-content {
  margin-left: 0;
  margin-right: var(--sidebar-width);
}

@media (max-width: 991.98px) {
  [dir="rtl"] .sidebar {
      right: -100%;
      left: auto;
  }
  
  [dir="rtl"] .sidebar.show {
      right: 0;
  }
  
  [dir="rtl"] .main-content {
      margin-right: 0;
  }
}