/*
Theme Name: Hars App Theme - Premium v5 (Glassmorphism & Mobile First)
Author: Hars Team
Description: تصميم احترافي متجاوب بالكامل مع هوية بصرية عصرية
Version: 5.0
*/

:root {
  /* --- Premium Color Palette (Emerald & Slate) --- */
  --primary: #10b981;
  /* Emerald 500 */
  --primary-dark: #047857;
  /* Emerald 700 */
  --primary-light: #d1fae5;
  /* Emerald 100 */
  --secondary: #f59e0b;
  /* Amber 500 (Highlights) */

  --bg-body: #f3f4f6;
  /* Cool Gray 100 */
  --bg-surface: #ffffff;

  --text-main: #1f2937;
  /* Gray 800 */
  --text-muted: #6b7280;
  /* Gray 500 */

  --border: #e5e7eb;
  /* Gray 200 */
  --border-focus: #10b981;

  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;

  /* --- Typography --- */
  --font-main: 'Tajawal', sans-serif;

  /* --- Effects --- */
  --radius: 16px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
  --shadow-premium: 0 20px 40px -10px rgba(16, 185, 129, 0.15);

  --glass-bg: rgba(255, 255, 255, 0.95);
  --glass-border: 1px solid rgba(255, 255, 255, 0.2);
  --backdrop: blur(12px);
}

/* --- Global Reset & Base --- */
* {
  box-sizing: border-box;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-main);
  direction: rtl;
  line-height: 1.6;
  background-image: radial-gradient(circle at top left, #d1fae5 0%, transparent 40%),
    radial-gradient(circle at bottom right, #e0f2fe 0%, transparent 40%);
  background-attachment: fixed;
}

a {
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* --- Layout --- */
.app-container {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
  min-height: 100vh;
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Modern Header --- */
.app-header {
  background: var(--glass-bg);
  backdrop-filter: var(--backdrop);
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 999;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 15px;
}

.brand-area {
  display: flex;
  align-items: center;
  gap: 15px;
}

.school-logo {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}

.logo h1 {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
  letter-spacing: -0.5px;
}

.logo p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.user-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.user-actions a,
.logout-btn {
  font-size: 0.9rem;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 50px;
  background: #f3f4f6;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
}

.user-actions a:hover,
.logout-btn:hover {
  background: #fee2e2;
  color: var(--danger);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* --- Premium Cards --- */
.card,
.sys-card,
.welcome-card {
  background: var(--bg-surface);
  border-radius: var(--radius);
  padding: 30px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 25px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card:hover,
.sys-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
  transform: translateY(-3px);
}

/* --- Modern Tabs --- */
.tabs-header {
  background: var(--bg-surface);
  padding: 10px;
  border-radius: var(--radius);
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  border: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  box-shadow: var(--shadow-sm);
}

.tabs-header::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  padding: 12px 25px;
  border-radius: 12px;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-family: inherit;
  font-size: 0.95rem;
}

.tab-btn:hover {
  background: #f9fafb;
  color: var(--text-main);
}

.tab-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* --- Inputs & Forms --- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.form-group label,
.inp-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
}

.form-input,
.sys-input,
select,
textarea {
  width: 100%;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  transition: 0.3s;
  background: #f9fafb;
  color: var(--text-main);
}

.form-input:focus,
.sys-input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

/* --- Buttons --- */
.btn {
  padding: 14px 28px;
  border-radius: 12px;
  border: none;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 1rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.btn-primary,
.btn-main {
  background: var(--primary);
  color: white;
}

.btn-primary:hover,
.btn-main:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(16, 185, 129, 0.2);
}

.btn-secondary {
  background: var(--text-main);
  color: white;
}

.btn-secondary:hover {
  background: black;
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text-main);
  box-shadow: none;
}

.btn-outline:hover {
  border-color: var(--text-main);
  background: var(--text-main);
  color: white;
}

/* --- Tables (Desktop) --- */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: white;
}

.data-table,
.sys-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.sys-table th {
  background: #f9fafb;
  color: var(--text-muted);
  padding: 18px;
  text-align: right;
  font-size: 0.85rem;
  font-weight: 800;
  border-bottom: 1px solid var(--border);
}

.data-table td,
.sys-table td {
  padding: 18px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  vertical-align: middle;
}

.data-table tr:hover,
.sys-table tr:hover {
  background: #f9fafb;
}

.data-table tr:last-child td,
.sys-table tr:last-child td {
  border-bottom: none;
}

/* --- Badges & Alerts --- */
.badge {
  padding: 6px 12px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.badge.success {
  background: #d1fae5;
  color: #065f46;
}

.badge.danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge.warning {
  background: #fef3c7;
  color: #92400e;
}

.badge.info {
  background: #dbeafe;
  color: #1e40af;
}

.alert {
  padding: 18px;
  border-radius: 12px;
  margin-bottom: 25px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
}

.alert.success {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.alert.error {
  background: #fef2f2;
  color: #991b1b;
  border-color: #fecaca;
}

/* ================= MOBILE OPTIMIZATIONS (Max Width 768px) ================= */
@media (max-width: 768px) {
  body {
    font-size: 15px;
    background-attachment: scroll;
  }

  .app-container {
    margin: 15px auto;
    padding: 0 12px;
  }

  /* Header */
  .app-header {
    padding: 12px 15px;
    gap: 10px;
  }

  .logo h1 {
    font-size: 1.1rem;
  }

  .logo p {
    display: none;
  }

  .user-actions a span,
  .logout-btn span {
    display: none;
  }

  .user-actions a,
  .logout-btn {
    padding: 8px 12px;
    border-radius: 10px;
  }

  /* Tabs */
  .tabs-header {
    padding: 5px;
    flex-wrap: nowrap;
    overflow-x: scroll;
  }

  .tab-btn {
    padding: 10px 15px;
    font-size: 0.9rem;
    border-radius: 10px;
    flex: 0 0 auto;
  }

  /* Layout */
  .settings-grid,
  .form-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .sidebar,
  .settings-sidebar {
    border: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
    margin-bottom: 20px;
  }

  /* Inputs & Buttons */
  .form-input,
  .sys-input,
  .btn {
    width: 100%;
    font-size: 16px;
    min-height: 48px;
  }

  /* Accessability */

  /* Tables -> Cards (Global) */
  .table-wrapper {
    border: none;
    background: transparent;
  }

  .data-table,
  .sys-table,
  .data-table thead,
  .sys-table thead {
    display: block;
  }

  .data-table thead,
  .sys-table thead {
    display: none;
  }

  /* Hide Header */

  .data-table tr,
  .sys-table tr {
    display: block;
    background: white;
    margin-bottom: 15px;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    padding: 5px 0;
  }

  .data-table td,
  .sys-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    padding: 12px 15px;
    border-bottom: 1px solid #f3f4f6;
  }

  .data-table td:last-child,
  .sys-table td:last-child {
    border-bottom: none;
    background: #f9fafb;
    justify-content: center;
    width: 100%;
    display: flex;
  }

  .data-table td::before,
  .sys-table td::before {
    content: attr(data-label);
    font-weight: 800;
    color: var(--text-muted);
    font-size: 0.85rem;
  }
}

/* --- Utilities --- */
.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-red {
  color: var(--danger);
}

.text-green {
  color: var(--success);
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

.d-flex {
  display: flex;
}

.gap-10 {
  gap: 10px;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}