/**
 * Hossam Shaker — Intelligent IT Support Design System
 * Master CSS (v2.0)
 * Colors: Indigo (#6366F1), Violet (#8B5CF6), Cyan (#06B6D4), Deep Dark (#0B1020)
 * Typography: Inter (Latin) & Cairo (Arabic)
 */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* Brand Core */
  --hs-primary: #6366F1;
  --hs-primary-hover: #4F46E5;
  --hs-primary-light: rgba(99, 102, 241, 0.12);
  --hs-primary-glow: 0 0 25px rgba(99, 102, 241, 0.4);
  
  --hs-violet: #8B5CF6;
  --hs-cyan: #06B6D4;
  --hs-cyan-glow: 0 0 20px rgba(6, 182, 212, 0.5);
  
  /* Deep Dark Theme */
  --hs-dark-bg: #0B1020;
  --hs-dark-surface: #111827;
  --hs-dark-card: #1E293B;
  --hs-dark-border: rgba(255, 255, 255, 0.08);
  --hs-dark-text: #F8FAFC;
  --hs-dark-muted: #94A3B8;

  /* Clean Light Theme */
  --hs-light-bg: #F8FAFC;
  --hs-light-surface: #FFFFFF;
  --hs-light-card: #FFFFFF;
  --hs-light-border: #E2E8F0;
  --hs-light-text: #0F172A;
  --hs-light-muted: #64748B;

  /* Gradients */
  --hs-grad-brand: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #06B6D4 100%);
  --hs-grad-dark: linear-gradient(180deg, #0B1020 0%, #111827 100%);
  --hs-grad-card: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
  --hs-grad-ai: linear-gradient(135deg, #06B6D4 0%, #6366F1 100%);

  /* Status Colors */
  --hs-success: #10B981;
  --hs-warning: #F59E0B;
  --hs-danger: #EF4444;
  --hs-info: #0284C7;

  /* Typography */
  --hs-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --hs-font-ar: 'Cairo', sans-serif;

  /* Elevation */
  --hs-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --hs-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
  --hs-shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.12), 0 4px 8px rgba(15, 23, 42, 0.06);
  --hs-shadow-glow: 0 0 35px rgba(99, 102, 241, 0.25);
  
  --hs-sidebar-width: 260px;
  --hs-sidebar-collapsed: 78px;
  --hs-header-height: 70px;
}

/* Global resets & typography */
body {
  font-family: var(--hs-font-sans);
  background-color: var(--hs-light-bg);
  color: var(--hs-light-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

[lang="ar"], [dir="rtl"] {
  font-family: var(--hs-font-ar);
}

/* Gradient Text Helper */
.hs-gradient-text {
  background: var(--hs-grad-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}

/* ==========================================================================
   Floating Pill Sidebar
   ========================================================================== */
.hs-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.hs-sidebar {
  width: var(--hs-sidebar-width);
  background: var(--hs-dark-bg);
  color: var(--hs-dark-text);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-right: 1px solid var(--hs-dark-border);
  z-index: 1040;
  position: relative;
}

.hs-sidebar-brand {
  height: var(--hs-header-height);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 0.75rem;
  border-bottom: 1px solid var(--hs-dark-border);
  text-decoration: none;
  color: #FFFFFF;
}

.hs-sidebar-brand:hover {
  color: #FFFFFF;
}

.hs-brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--hs-grad-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--hs-primary-glow);
  flex-shrink: 0;
}

.hs-brand-title {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: #FFFFFF;
  line-height: 1.2;
}

.hs-brand-sub {
  font-size: 0.68rem;
  color: var(--hs-cyan);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.hs-nav-wrapper {
  padding: 1.25rem 0.85rem;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.hs-nav-section {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: #64748B;
  padding: 0.75rem 0.85rem 0.35rem;
}

.hs-nav-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.95rem;
  border-radius: 12px;
  color: #94A3B8;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  transition: all 0.2s ease;
  position: relative;
}

.hs-nav-link i {
  font-size: 1.05rem;
  width: 22px;
  text-align: center;
  color: #64748B;
  transition: color 0.2s ease;
}

.hs-nav-link:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.06);
}

.hs-nav-link:hover i {
  color: var(--hs-cyan);
}

.hs-nav-link.active {
  color: #FFFFFF;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(139, 92, 246, 0.18) 100%);
  border: 1px solid rgba(99, 102, 241, 0.35);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.15);
  font-weight: 600;
}

.hs-nav-link.active i {
  color: var(--hs-cyan);
}

.hs-nav-link .badge {
  margin-left: auto;
  font-size: 0.72rem;
  padding: 0.25em 0.6em;
  border-radius: 20px;
}

/* AI Highlight Link */
.hs-nav-link-ai {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15) 0%, rgba(99, 102, 241, 0.15) 100%);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #E2E8F0;
}

.hs-nav-link-ai:hover {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25) 0%, rgba(99, 102, 241, 0.25) 100%);
  border-color: var(--hs-cyan);
  box-shadow: var(--hs-cyan-glow);
}

/* Sidebar Footer / User card */
.hs-sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--hs-dark-border);
  background: rgba(0, 0, 0, 0.2);
}

.hs-user-chip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hs-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--hs-grad-brand);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.hs-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #F8FAFC;
  line-height: 1.2;
}

.hs-user-role {
  font-size: 0.72rem;
  color: var(--hs-cyan);
  text-transform: capitalize;
}

/* ==========================================================================
   Main Content & Top Navigation
   ========================================================================== */
.hs-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: var(--hs-light-bg);
}

.hs-navbar {
  height: var(--hs-header-height);
  background: #FFFFFF;
  border-bottom: 1px solid var(--hs-light-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 1020;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.hs-search-trigger {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  color: #64748B;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 280px;
}

.hs-search-trigger:hover {
  background: #E2E8F0;
  border-color: #CBD5E1;
  color: #334155;
}

.hs-search-kbd {
  margin-left: auto;
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  padding: 0.1rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748B;
}

.hs-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* Hossam AI Trigger Button */
.hs-ai-btn {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--hs-grad-brand);
  color: #FFFFFF;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.hs-ai-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
  color: #FFFFFF;
}

.hs-ai-orb-pulse {
  width: 9px;
  height: 9px;
  background: #06B6D4;
  border-radius: 50%;
  box-shadow: 0 0 10px #06B6D4;
  animation: hs-pulse 1.8s infinite;
}

@keyframes hs-pulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.7);
  }
  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 8px rgba(6, 182, 212, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(6, 182, 212, 0);
  }
}

/* Content Container */
.hs-content {
  padding: 2rem;
  flex: 1;
}

/* ==========================================================================
   Modern Cards & Stat Widgets
   ========================================================================== */
.hs-card {
  background: #FFFFFF;
  border-radius: 16px;
  border: 1px solid var(--hs-light-border);
  box-shadow: var(--hs-shadow-sm);
  transition: all 0.2s ease;
  overflow: hidden;
}

.hs-card:hover {
  box-shadow: var(--hs-shadow-md);
}

.hs-card-dark {
  background: var(--hs-dark-surface);
  border: 1px solid var(--hs-dark-border);
  color: #F8FAFC;
}

.hs-glass-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
}

/* AI Hero Banner */
.hs-ai-banner {
  background: linear-gradient(135deg, #0B1020 0%, #171E36 100%);
  border-radius: 20px;
  padding: 2rem 2.5rem;
  color: #FFFFFF;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(99, 102, 241, 0.25);
  box-shadow: 0 10px 30px rgba(11, 16, 32, 0.2);
  margin-bottom: 2rem;
}

.hs-ai-banner::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, rgba(6, 182, 212, 0.15) 50%, transparent 70%);
  pointer-events: none;
}

.hs-stat-card {
  background: #FFFFFF;
  border: 1px solid var(--hs-light-border);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.hs-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--hs-shadow-md);
  border-color: #CBD5E1;
}

.hs-stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hs-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.hs-stat-icon-indigo {
  background: rgba(99, 102, 241, 0.1);
  color: var(--hs-primary);
}

.hs-stat-icon-cyan {
  background: rgba(6, 182, 212, 0.1);
  color: var(--hs-cyan);
}

.hs-stat-icon-emerald {
  background: rgba(16, 185, 129, 0.1);
  color: var(--hs-success);
}

.hs-stat-icon-rose {
  background: rgba(239, 68, 68, 0.1);
  color: var(--hs-danger);
}

.hs-stat-val {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0F172A;
  line-height: 1.1;
}

.hs-stat-label {
  font-size: 0.85rem;
  color: #64748B;
  font-weight: 500;
}

.hs-stat-trend {
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}

/* ==========================================================================
   Modern Status Badges & Chips
   ========================================================================== */
.hs-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.hs-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.hs-badge-open {
  background: #EFF6FF;
  color: #2563EB;
}
.hs-badge-open .hs-badge-dot { background: #2563EB; }

.hs-badge-progress {
  background: #F5F3FF;
  color: #7C3AED;
}
.hs-badge-progress .hs-badge-dot { background: #7C3AED; }

.hs-badge-waiting {
  background: #FFFBEB;
  color: #D97706;
}
.hs-badge-waiting .hs-badge-dot { background: #D97706; }

.hs-badge-resolved {
  background: #ECFDF5;
  color: #059669;
}
.hs-badge-resolved .hs-badge-dot { background: #059669; }

.hs-badge-closed {
  background: #F1F5F9;
  color: #475569;
}
.hs-badge-closed .hs-badge-dot { background: #475569; }

.hs-badge-critical, .hs-badge-urgent {
  background: #FEF2F2;
  color: #DC2626;
  border: 1px solid #FECACA;
}
.hs-badge-critical .hs-badge-dot, .hs-badge-urgent .hs-badge-dot { background: #DC2626; }

/* ==========================================================================
   SLA Circular & Progress Meters
   ========================================================================== */
.hs-sla-gauge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.hs-sla-progress-bar {
  height: 8px;
  border-radius: 4px;
  background: #E2E8F0;
  overflow: hidden;
  position: relative;
}

.hs-sla-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

.hs-sla-fill-healthy {
  background: linear-gradient(90deg, #10B981, #059669);
}

.hs-sla-fill-warning {
  background: linear-gradient(90deg, #F59E0B, #D97706);
}

.hs-sla-fill-breached {
  background: linear-gradient(90deg, #EF4444, #B91C1C);
}

/* ==========================================================================
   Hossam AI Slide-out Drawer
   ========================================================================== */
.hs-ai-drawer {
  position: fixed;
  top: 0;
  right: -460px;
  width: 440px;
  height: 100vh;
  background: #0B1020;
  color: #F8FAFC;
  z-index: 1060;
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.4);
  transition: right 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--hs-dark-border);
}

.hs-ai-drawer.open {
  right: 0;
}

.hs-ai-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(11, 16, 32, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1055;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.hs-ai-drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.hs-ai-drawer-header {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--hs-dark-border);
  background: rgba(255, 255, 255, 0.02);
}

.hs-ai-drawer-body {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hs-ai-drawer-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--hs-dark-border);
  background: rgba(0, 0, 0, 0.2);
}

/* Chat Bubbles */
.hs-ai-msg {
  display: flex;
  gap: 0.75rem;
  max-width: 90%;
}

.hs-ai-msg-bot {
  align-self: flex-start;
}

.hs-ai-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.hs-ai-bubble {
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.hs-ai-msg-bot .hs-ai-bubble {
  background: #171E36;
  border: 1px solid rgba(6, 182, 212, 0.2);
  color: #F8FAFC;
}

.hs-ai-msg-user .hs-ai-bubble {
  background: var(--hs-primary);
  color: #FFFFFF;
}

.hs-ai-input-box {
  position: relative;
  display: flex;
  align-items: center;
}

.hs-ai-input {
  width: 100%;
  background: #171E36;
  border: 1px solid var(--hs-dark-border);
  border-radius: 12px;
  color: #FFFFFF;
  padding: 0.75rem 2.75rem 0.75rem 1rem;
  font-size: 0.88rem;
}

.hs-ai-input:focus {
  outline: none;
  border-color: var(--hs-cyan);
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
}

.hs-ai-send-btn {
  position: absolute;
  right: 8px;
  background: var(--hs-grad-brand);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ==========================================================================
   Command Palette Modal (Ctrl + K)
   ========================================================================== */
.hs-palette-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1070;
  background: rgba(11, 16, 32, 0.7);
  backdrop-filter: blur(8px);
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}

.hs-palette-modal.open {
  display: flex;
}

.hs-palette-container {
  width: 100%;
  max-width: 620px;
  background: #0B1020;
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(99, 102, 241, 0.2);
  overflow: hidden;
  animation: hs-slide-down 0.2s ease-out;
}

@keyframes hs-slide-down {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hs-palette-input-wrap {
  display: flex;
  align-items: center;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--hs-dark-border);
  gap: 0.75rem;
}

.hs-palette-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #FFFFFF;
  font-size: 1.05rem;
  outline: none;
}

.hs-palette-results {
  max-height: 360px;
  overflow-y: auto;
  padding: 0.75rem;
}

.hs-palette-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  color: #CBD5E1;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}

.hs-palette-item:hover, .hs-palette-item.selected {
  background: rgba(99, 102, 241, 0.15);
  color: #FFFFFF;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 991px) {
  .hs-sidebar {
    position: fixed;
    top: 0;
    left: -260px;
    height: 100vh;
  }
  .hs-sidebar.show {
    left: 0;
  }
  .hs-search-trigger {
    min-width: auto;
  }
  .hs-ai-drawer {
    width: 100%;
    right: -100%;
  }
}
