/* =============================================
   HumanRise Academy - Custom Styles
   ============================================= */

/* Root Variables */
:root {
  --gold: #d49a42;
  --brown: #c18931;
  --blue: #008ab0;
  --light-blue: #00acdb;
  --dark-blue: #00acdb;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: inherit;
  line-height: 1.6;
  color: var(--gray-800);
  background-color: var(--gray-50);
}

[dir="rtl"] body {
  direction: rtl;
  font-family: "Cairo", sans-serif;
}

[dir="ltr"] body {
  direction: ltr;
  font-family: "Inter", sans-serif;
}

/* =============================================
   Hero Section Styles
   ============================================= */
.hero-section {
  position: relative;
  background-image: url("https://images.unsplash.com/photo-1522202176988-66273c2fd55f?w=1920&q=80");
  background-size: cover;
  background-position: center;
  background-attachment: scroll;
}

@media (min-width: 768px) {
  .hero-section {
    background-attachment: fixed;
  }
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 172, 219, 0.8);
}

.hero-content {
  position: relative;
  z-index: 10;
}

/* =============================================
   Decorative Shapes
   ============================================= */
.hero-shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.3;
  z-index: 5;
}

.shape-1 {
  width: 150px;
  height: 150px;
  background: rgba(37, 99, 235, 0.4);
  top: -75px;
  right: -75px;
}

@media (min-width: 640px) {
  .shape-1 {
    width: 200px;
    height: 200px;
    top: -100px;
    right: -100px;
  }
}

@media (min-width: 768px) {
  .shape-1 {
    width: 300px;
    height: 300px;
  }
}

.shape-2 {
  width: 100px;
  height: 100px;
  background: rgba(234, 179, 8, 0.3);
  bottom: -50px;
  left: -50px;
}

@media (min-width: 640px) {
  .shape-2 {
    width: 150px;
    height: 150px;
  }
}

@media (min-width: 768px) {
  .shape-2 {
    width: 250px;
    height: 250px;
  }
}

.shape-3 {
  width: 80px;
  height: 80px;
  background: rgba(59, 130, 246, 0.35);
  top: 50%;
  left: 5%;
  display: none;
}

@media (min-width: 1024px) {
  .shape-3 {
    width: 200px;
    height: 200px;
    left: 10%;
    display: block;
  }
}

/* =============================================
   Utility Classes
   ============================================= */
.blue-text {
  color: var(--blue);
}

.gold-text {
  color: var(--gold);
}

.login-gradient {
  background: linear-gradient(135deg, #008ab0 0%, #00acdb 100%);
}

/* =============================================
   Form Styles
   ============================================= */
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: all 0.2s ease;
  background-color: white;
}

.form-control:focus {
  outline: none;
  border-color: var(--light-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.form-control.is-invalid {
  border-color: var(--danger);
}

.form-control.is-valid {
  border-color: var(--success);
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--gray-700);
}

.form-group {
  margin-bottom: 1.5rem;
}

.input-group {
  position: relative;
}

.input-group .form-control {
  padding-inline-end: 2.5rem;
}

.input-group-icon {
  position: absolute;
  top: 50%;
  inset-inline-end: 1rem;
  transform: translateY(-50%);
  color: var(--gray-400);
}

/* =============================================
   Button Styles
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue) 0%, var(--light-blue) 100%);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--dark-blue) 0%, var(--blue) 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.4);
}

.btn-secondary {
  background-color: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
  background-color: var(--gray-200);
}

.btn-success {
  background: linear-gradient(135deg, #059669 0%, var(--success) 100%);
  color: white;
}

.btn-success:hover {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626 0%, var(--danger) 100%);
  color: white;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
}

.btn-gold {
  background: linear-gradient(135deg, var(--brown) 0%, var(--gold) 100%);
  color: white;
}

.btn-gold:hover {
  background: linear-gradient(135deg, #7a5f13 0%, var(--brown) 100%);
}

.btn-outline {
  background: transparent;
  border: 2px solid currentColor;
}

.btn-outline:hover {
  background: currentColor;
  color: white;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-block {
  width: 100%;
}

/* =============================================
   Card Styles
   ============================================= */
.card {
  background: white;
  border-radius: 1rem;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transform: translateY(-4px);
}

.card-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card-body {
  padding: 1.5rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.5rem;
}

.card-text {
  color: var(--gray-600);
  margin-bottom: 1rem;
}

/* =============================================
   Course Card Specific
   ============================================= */
.course-card {
  position: relative;
}

.course-badge {
  position: absolute;
  top: 1rem;
  inset-inline-end: 1rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-featured {
  background: linear-gradient(135deg, var(--brown) 0%, var(--gold) 100%);
  color: white;
}

.badge-new {
  background: var(--success);
  color: white;
}

.badge-sale {
  background: var(--danger);
  color: white;
}

.course-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  color: var(--gray-500);
  font-size: 0.875rem;
}

.course-meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.course-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--blue);
}

.course-price-original {
  font-size: 1rem;
  color: var(--gray-400);
  text-decoration: line-through;
  margin-right: 0.5rem;
}

/* =============================================
   Navigation Styles
   ============================================= */
.navbar {
  background: white;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-link {
  color: var(--gray-600);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--blue);
  background: rgba(59, 130, 246, 0.1);
}

/* =============================================
   Alert Styles
   ============================================= */
.alert {
  padding: 1rem 1.25rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-danger {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.alert-info {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* =============================================
   Table Styles
   ============================================= */
.table-container {
  overflow-x: auto;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.table th,
.table td {
  padding: 1rem;
  text-align: start;
  border-bottom: 1px solid var(--gray-200);
}

.table th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-700);
}

.table tbody tr:hover {
  background: var(--gray-50);
}

/* =============================================
   Staff Dashboard Styles
   ============================================= */
.staff-sidebar {
  background: linear-gradient(135deg, var(--blue) 0%, var(--light-blue) 100%);
  min-height: 100vh;
  width: 280px;
  position: fixed;
  inset-inline-end: 0;
  top: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all 0.2s ease;
  border-radius: 0.5rem;
  margin: 0.25rem 1rem;
}

.sidebar-link:hover,
.sidebar-link.active {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.staff-main {
  margin-inline-end: 280px;
  padding: 2rem;
  background: var(--gray-100);
  min-height: 100vh;
}

@media (max-width: 768px) {
  .staff-sidebar {
    width: 100%;
    position: relative;
    min-height: auto;
  }

  .staff-main {
    margin-right: 0;
  }
}

/* =============================================
   Stats Card
   ============================================= */
.stat-card {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.stat-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.stat-icon-blue {
  background: #dbeafe;
  color: var(--blue);
}

.stat-icon-green {
  background: #d1fae5;
  color: var(--success);
}

.stat-icon-gold {
  background: #fef3c7;
  color: var(--brown);
}

.stat-icon-purple {
  background: #ede9fe;
  color: #7c3aed;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gray-800);
}

.stat-label {
  color: var(--gray-500);
  font-size: 0.875rem;
}

/* =============================================
   Smooth Scrolling & Accessibility
   ============================================= */
html {
  scroll-behavior: smooth;
}

button:focus,
a:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid var(--gray-200);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* =============================================
   Pagination
   ============================================= */
.pagination {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 2rem;
}

.page-link {
  padding: 0.5rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.375rem;
  color: var(--gray-700);
  text-decoration: none;
  transition: all 0.2s ease;
}

.page-link:hover,
.page-link.active {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

/* =============================================
   Modal Styles
   ============================================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: white;
  border-radius: 1rem;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: all 0.3s ease;
}

.modal-overlay.show .modal {
  transform: scale(1);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

/* =============================================
   Dropdown Styles
   ============================================= */
.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border-radius: 0.5rem;
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s ease;
  z-index: 100;
}

.dropdown:hover .dropdown-menu,
.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--gray-700);
  text-decoration: none;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background: var(--gray-100);
  color: var(--blue);
}

/* =============================================
   Tooltip
   ============================================= */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-800);
  color: white;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
}

[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
}

/* =============================================
   Print Styles
   ============================================= */
@media print {
  nav,
  footer,
  .no-print,
  .staff-sidebar {
    display: none !important;
  }

  body {
    background: white;
  }

  .staff-main {
    margin-right: 0;
  }
}

/* =============================================
   Animation Classes
   ============================================= */
.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-in-right {
  animation: slideInRight 0.3s ease forwards;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* =============================================
   Custom Scrollbar
   ============================================= */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}

/* =============================================
   Responsive Utilities
   ============================================= */
@media (max-width: 640px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 641px) and (max-width: 1024px) {
  .hide-tablet {
    display: none !important;
  }
}

@media (min-width: 1025px) {
  .hide-desktop {
    display: none !important;
  }
}
/* --- Advanced Footer Enhancements --- */
.footer-wave {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  transform: rotate(180deg);
}

.footer-wave svg {
  position: relative;
  display: block;
  width: calc(100% + 1.3px);
  height: 40px;
}

.footer-wave .shape-fill {
  fill: #0b0f19;
}

.footer-social-link {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #9ca3af;
  text-decoration: none;
}

.footer-social-link:hover {
  box-shadow: 0 10px 20px -5px var(--hover-color, #3b82f6);
  background: var(--hover-color, #3b82f6);
  border-color: transparent;
  color: white !important;
}

.footer-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem 1.5rem;
  border-radius: 1rem;
  color: white;
  outline: none;
  transition: all 0.3s ease;
  width: 100%;
}

.footer-input:focus {
  border-color: #3b82f6;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.footer-link-premium {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #9ca3af;
  transition: all 0.3s ease;
  text-decoration: none;
}

.footer-link-premium:hover {
  color: white !important;
  transform: translateX(-5px);
}

.btn-shine {
  position: relative;
  overflow: hidden;
}

.btn-shine::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0) 40%,
    rgba(255, 255, 255, 0.4) 50%,
    rgba(255, 255, 255, 0) 60%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(45deg);
  transition: all 0.5s;
  opacity: 0;
}

.btn-shine:hover::after {
  animation: footerShine 1.2s infinite;
  opacity: 1;
}

@keyframes footerShine {
  0% {
    left: -100%;
    top: -100%;
  }
  100% {
    left: 100%;
    top: 100%;
  }
}
/* =============================================
   Premium Form Controls
   ============================================= */
.premium-input {
  padding: 1rem 1.5rem;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  outline: none;
  font-weight: 700;
  color: #1e293b;
  transition: all 0.3s ease;
  width: 100%;
}

.premium-input:focus {
  background-color: #ffffff;
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0, 194, 238, 0.1);
}

/* Specific styling for Select dropdowns to fix arrows */
select.premium-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: var(--select-icon-pos, left 1.5rem center);
  background-size: 1.5em 1.5em;
  padding-inline-end: 3.5rem; /* Space for arrow */
}

[dir="rtl"] select.premium-input {
  --select-icon-pos: left 1.5rem center;
}

[dir="ltr"] select.premium-input {
  --select-icon-pos: right 1.5rem center;
}

.premium-file-input {
  display: block;
  width: 100%;
  color: #64748b;
  cursor: pointer;
}

.premium-file-input::-webkit-file-upload-button {
  margin-inline-end: 1rem;
  padding: 0.75rem 1.5rem;
  border-radius: 1rem;
  border: 0;
  font-size: 0.75rem;
  font-weight: 900;
  background-color: #eff6ff;
  color: #1d4ed8;
  transition: all 0.3s ease;
  cursor: pointer;
}

/* Helpers for bilingual text alignment */
[dir="rtl"] .text-left-rtl { text-align: left; }
[dir="ltr"] .text-right-ltr { text-align: right; }
