/* Common Styles for Raed-Tarbawe Dashboards (IT, Admin, Archive, Assistant Archive) */
@import url('https://fonts.googleapis.com/css2?family=Noto+Naskh+Arabic:wght@400;500;600;700;800&family=Amiri:ital,wght@0,400;0,700;1,400;1,700&family=Scheherazade+New:wght@400;700&display=swap');

:root {
  --main: #00fbff;
  --main-dark: #00bcd4;
  --bg: #0a0a0a;
  --card: #161616;
  --card-border: #262626;
  --red: #ff4d4d;
  --green: #28a745;
  --yellow: #ffc107;
  --gray: #888;
  --text: #ffffff;
  --text-muted: #aaaaaa;
}

* {
  box-sizing: border-box;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Naskh Arabic', 'Amiri', 'Scheherazade New', 'Traditional Arabic', serif;
  margin: 0;
  padding: 16px;
  direction: rtl;
  font-size: 16px;
  line-height: 1.6;
}

h1, h2, h3, h4, h5 {
  font-weight: 700;
  margin-top: 0;
}

h2 {
  color: var(--main);
  border-bottom: 2px solid var(--main);
  padding-bottom: 10px;
  margin-bottom: 20px;
  font-size: 22px;
}

/* Header & Top Bar */
.dashboard-header {
  background: #121212;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.dashboard-title-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dashboard-title-area h1 {
  font-size: 20px;
  color: #fff;
  margin: 0;
}

.role-badge {
  background: rgba(0, 251, 255, 0.15);
  color: var(--main);
  border: 1px solid var(--main);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.session-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.session-chip {
  color: var(--yellow);
  font-size: 14px;
  font-weight: 600;
}

/* Navigation Tabs */
.admin-tabs-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--card-border);
}

.admin-tabs-nav::-webkit-scrollbar {
  height: 6px;
}
.admin-tabs-nav::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}

.admin-tab-btn {
  background: #181818;
  color: #ccc;
  border: 1px solid #333;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-tab-btn:hover {
  background: #252525;
  color: #fff;
  border-color: #444;
}

.admin-tab-btn.active {
  background: var(--main);
  color: #000;
  border-color: var(--main);
  font-weight: 700;
}

/* Sections & Cards */
.section {
  background: #121212;
  padding: 24px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  margin-bottom: 30px;
}

.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

.box-card {
  background: #181818;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 20px;
}

.box-title {
  color: var(--main);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}

/* Forms & Inputs */
input, select, textarea {
  padding: 12px 14px;
  border-radius: 8px;
  background: #000;
  border: 1px solid #333;
  color: white;
  margin-bottom: 12px;
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--main);
}

.flex-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.btn {
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  transition: opacity 0.2s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn:active {
  transform: scale(0.98);
}
.btn:hover {
  opacity: 0.9;
}

.btn-add, .btn-primary {
  background: var(--main);
  color: #000;
}

.btn-del, .btn-danger {
  background: var(--red);
  color: #fff;
}

.btn-warning {
  background: var(--yellow);
  color: #000;
}

.btn-secondary {
  background: #333;
  color: #fff;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

/* Grids */
.staff-grid, .media-grid, .cat-grid, .figures-grid {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.staff-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.media-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.cat-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.figures-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.staff-card, .video-card, .cat-card, .figure-card {
  background: #181818;
  border-radius: 10px;
  border: 1px solid #2a2a2a;
  padding: 16px;
  position: relative;
  overflow: hidden;
}

.video-card {
  padding: 0 !important;
  display: flex;
  flex-direction: column;
}

.video-card .media-preview-box {
  margin: 0;
  width: 100%;
}

.video-card .media-preview-box video,
.video-card .media-preview-box img,
.video-card .media-preview-box iframe {
  border-radius: 10px 10px 0 0 !important;
  border: none !important;
  border-bottom: 1px solid #2a2a2a !important;
  width: 100% !important;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #000;
  display: block;
}

.video-card .media-preview-box div:last-child {
  padding: 4px 12px;
}

.staff-card {
  border-right: 4px solid var(--main);
}

.cat-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-right: 4px solid var(--yellow);
}

.badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  display: inline-block;
}

.badge-approved { background: rgba(40, 167, 69, 0.2); color: #2ecc71; border: 1px solid #2ecc71; }
.badge-pending-admin { background: rgba(255, 193, 7, 0.2); color: #ffc107; border: 1px solid #ffc107; }
.badge-pending-archive { background: rgba(0, 251, 255, 0.2); color: #00fbff; border: 1px solid #00fbff; }
.badge-frozen { background: rgba(255, 77, 77, 0.2); color: #ff4d4d; border: 1px solid #ff4d4d; }

/* Tables */
.table-wrap {
  overflow-x: auto;
  border: 1px solid #262626;
  border-radius: 8px;
  margin-top: 14px;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
}

.custom-table th, .custom-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #262626;
  text-align: right;
  font-size: 14px;
}

.custom-table th {
  background: #000;
  color: var(--main);
  font-weight: 700;
}

.custom-table tr:hover {
  background: #151515;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 16px;
  backdrop-filter: blur(4px);
}

.modal-backdrop.active {
  display: flex;
}

.modal-card {
  background: #141414;
  border: 1px solid #333;
  border-radius: 14px;
  padding: 24px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-card h3 {
  color: var(--main);
  margin-top: 0;
  margin-bottom: 16px;
  border-bottom: 1px solid #262626;
  padding-bottom: 10px;
}

/* Toast */
.toast-notification {
  position: fixed;
  bottom: 24px;
  left: 24px;
  background: #28a745;
  color: #fff;
  padding: 14px 24px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  z-index: 100000;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  pointer-events: none;
}
.toast-notification.show {
  opacity: 1;
  transform: translateY(0);
}
.toast-notification.error {
  background: #e74c3c;
}

/* =========================================================
   Portal In-Page Authentication Card & Notice
   ========================================================= */
.portal-auth-wrap {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.portal-auth-card {
  width: 100%;
  max-width: 480px;
  background: #141414;
  border: 1px solid #2a2a2a;
  border-radius: 18px;
  padding: 32px 28px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
  text-align: center;
  position: relative;
}

.portal-auth-card .portal-badge {
  display: inline-block;
  background: rgba(0, 251, 255, 0.12);
  color: var(--main);
  border: 1px solid var(--main);
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
}

.portal-auth-card h2 {
  font-size: 22px;
  color: #fff;
  border-bottom: none;
  margin-bottom: 8px;
  padding-bottom: 0;
}

.portal-auth-card .portal-desc {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.portal-auth-card .form-group {
  text-align: right;
  margin-bottom: 16px;
}

.portal-auth-card label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #e0e0e0;
}

.portal-auth-card input {
  width: 100%;
  padding: 12px 14px;
  background: #000;
  border: 1px solid #333;
  border-radius: 8px;
  color: #fff;
  font-size: 15px;
  margin-bottom: 0;
  font-family: inherit;
  transition: border-color 0.2s ease;
}

.portal-auth-card input:focus {
  border-color: var(--main);
  outline: none;
}

.portal-auth-card .btn-submit {
  width: 100%;
  padding: 13px;
  background: var(--main);
  color: #000;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.portal-auth-card .btn-submit:hover {
  background: #00d5db;
  transform: translateY(-1px);
}

.portal-auth-card .btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.portal-auth-card .auth-msg {
  margin-top: 14px;
  font-size: 13px;
  font-weight: 700;
  min-height: 20px;
}

.portal-auth-card .back-home-link {
  display: inline-block;
  margin-top: 20px;
  color: var(--gray);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}

.portal-auth-card .back-home-link:hover {
  color: var(--main);
}

