/* RTL + premium internal content */

html[dir='rtl'] {
  --font-sans: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  --font-display: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}

html[dir='rtl'] .dashboard-main {
  margin-left: 0;
  margin-right: 0;
}

html[dir='rtl'] .topnav-brand {
  margin-left: 0;
  margin-right: var(--space-2);
}

html[dir='rtl'] .topnav-link:hover,
html[dir='rtl'] .topnav-link.active {
  transform: translateY(-1px);
}

html[dir='rtl'] .badge-soon {
  margin-left: 0;
  margin-right: auto;
}

html[dir='rtl'] .floating-group label {
  left: auto;
  right: 1rem;
}

html[dir='rtl'] .password-toggle {
  right: auto;
  left: 0.75rem;
}

html[dir='rtl'] .notification-dot {
  right: auto;
  left: 8px;
}

html[dir='rtl'] .project-facts-list li {
  flex-direction: row-reverse;
}

html[dir='rtl'] .delivery-card-head,
html[dir='rtl'] .order-meta-row,
html[dir='rtl'] .project-detail-hero-top {
  direction: rtl;
}

/* Premium dashboard content area */
.dashboard-content {
  position: relative;
  background:
    radial-gradient(ellipse 80% 50% at 100% 0%, rgba(99, 102, 241, 0.08), transparent 50%),
    radial-gradient(ellipse 60% 40% at 0% 100%, rgba(236, 72, 153, 0.06), transparent 45%),
    var(--bg-primary);
}

.dashboard-content::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  opacity: 0.4;
  mask-image: linear-gradient(to bottom, black 0%, transparent 85%);
}

.dashboard-content > * {
  position: relative;
  z-index: 1;
}

.dashboard-content .glass-card:not(.project-detail-hero) {
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.07) 0%,
    rgba(255, 255, 255, 0.03) 40%,
    rgba(15, 23, 42, 0.5) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 16px 48px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(24px);
}

.dashboard-content .glass-card:not(.project-detail-hero):hover {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 20px 56px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(99, 102, 241, 0.15);
  transform: translateY(-2px);
}

.dashboard-content .page-header {
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dashboard-content .page-title {
  background: linear-gradient(135deg, #f8fafc 0%, #c4b5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.dashboard-content .stat-card {
  position: relative;
  overflow: hidden;
}

.dashboard-content .stat-card::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.25), transparent 70%);
  pointer-events: none;
}

html[dir='rtl'] .dashboard-content .stat-card::after {
  right: auto;
  left: -20%;
}

.dashboard-content .project-card {
  transition:
    transform var(--transition),
    box-shadow var(--transition),
    border-color var(--transition);
}

.dashboard-content .project-card h3 a {
  transition: color var(--transition);
}

.dashboard-content .project-card:hover h3 a {
  color: #c4b5fd;
}

.dashboard-content .action-tile {
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.12), rgba(15, 23, 42, 0.6));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-xl);
  transition: all var(--transition);
}

.dashboard-content .action-tile:hover {
  border-color: rgba(167, 139, 250, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(99, 102, 241, 0.2);
}

.dashboard-content .project-panel {
  border-radius: var(--radius-2xl);
}

.dashboard-content .proposal-panel {
  border: 1px solid rgba(99, 102, 241, 0.25);
  box-shadow: 0 24px 64px rgba(99, 102, 241, 0.12);
}

.dashboard-content .empty-state {
  padding: var(--space-10);
  text-align: center;
}

.dashboard-content .btn-primary.btn-gradient {
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.35);
}

.dashboard-content .skill-tag {
  border: 1px solid rgba(99, 102, 241, 0.3);
  background: rgba(99, 102, 241, 0.12);
}

.auth-shell .glass-card {
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.02) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.minimal-shell .glass-card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(15, 23, 42, 0.55));
  border: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
  html[dir='rtl'] .topnav-links.open .topnav-link {
    text-align: right;
  }
}

html[dir='rtl'] .quick-actions {
  flex-direction: row-reverse;
}

html[dir='rtl'] .page-header {
  text-align: right;
}

html[dir='rtl'] .card-header {
  flex-direction: row-reverse;
}

/* Navbar notifications dropdown */
.notification-dropdown-wrap {
  position: relative;
}

.notification-btn {
  position: relative;
}

.notification-bell-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.notification-count-badge {
  position: absolute;
  top: 2px;
  left: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-secondary);
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.5);
}

html[dir='rtl'] .notification-count-badge {
  left: auto;
  right: 2px;
}

.notification-dropdown {
  position: fixed;
  top: 0;
  left: 0;
  width: min(380px, calc(100vw - 1.5rem));
  max-height: min(480px, 70vh);
  display: flex;
  flex-direction: column;
  background: linear-gradient(165deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-xl);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  z-index: 1200;
  overflow: hidden;
  animation: notificationDropIn 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes notificationDropIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.notification-dropdown-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border-glass);
  background: rgba(99, 102, 241, 0.08);
}

.notification-dropdown-header h3 {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  margin-bottom: 2px;
}

.notification-dropdown-sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.notification-dropdown-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-2);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.notification-dropdown-body::-webkit-scrollbar {
  width: 6px;
}

.notification-dropdown-body::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-full);
}

.notification-dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  text-align: right;
}

.notification-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-glass);
}

.notification-dropdown-item.unread {
  background: rgba(99, 102, 241, 0.12);
  border-color: rgba(99, 102, 241, 0.35);
}

.notification-dropdown-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.notification-dropdown-content {
  flex: 1;
  min-width: 0;
}

.notification-dropdown-title-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 4px;
}

.notification-dropdown-title-row strong {
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.3;
}

.notification-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #a78bfa;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(167, 139, 250, 0.8);
}

.notification-dropdown-content p {
  font-size: var(--text-xs);
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.notification-dropdown-content small {
  font-size: 11px;
  color: var(--text-muted);
}

.notification-dropdown-mark {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  cursor: pointer;
  font-size: 12px;
  transition: all var(--transition);
}

.notification-dropdown-mark:hover {
  background: rgba(16, 185, 129, 0.3);
}

.notification-dropdown-state,
.notification-dropdown-empty {
  padding: var(--space-8) var(--space-4);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.notification-dropdown-empty-icon {
  display: block;
  font-size: 2rem;
  margin-bottom: var(--space-3);
  opacity: 0.6;
}

.notification-dropdown-empty p {
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

.notification-dropdown-footer {
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.2);
  text-align: center;
}

.notification-dropdown-link {
  font-size: var(--text-sm);
  font-weight: 600;
  color: #c4b5fd;
}

.notification-dropdown-link:hover {
  color: #e9d5ff;
}

/* User menu dropdown (اسمي) */
.topnav-user-menu-wrap {
  position: relative;
}

.topnav-user-trigger {
  cursor: pointer;
  background: transparent;
  border: none;
  font: inherit;
  text-align: inherit;
}

.topnav-user-trigger.open,
.topnav-user-trigger:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-glass);
}

.topnav-user-chevron {
  font-size: 0.65rem;
  color: var(--text-muted);
  transition: transform var(--transition);
  margin-right: 0.15rem;
}

.topnav-user-trigger.open .topnav-user-chevron {
  transform: rotate(180deg);
}

.topnav-user-dropdown {
  position: fixed;
  top: 0;
  left: 0;
  min-width: 220px;
  padding: var(--space-2);
  background: linear-gradient(165deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-xl);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  z-index: 1200;
  animation: notificationDropIn 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.topnav-user-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 600;
  text-align: right;
  transition: all var(--transition);
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

.topnav-user-dropdown-item:hover,
.topnav-user-dropdown-item.active {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.15);
}

.topnav-user-dropdown-logout:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}

.topnav-user-dropdown-icon {
  width: 1.25rem;
  text-align: center;
  opacity: 0.9;
}

.topnav-user-dropdown-divider {
  height: 1px;
  margin: var(--space-2) var(--space-2);
  background: var(--border-glass);
}

.messages-btn .notification-bell-icon {
  font-size: 1.1rem;
}
