/* ═══════════════════════════════════════════════════════════════════════════
   Connect Talent CIO — Call Management Application
   Design System Styles (index.css)
   Google Stitch: Connect Talent Unified System
   ═══════════════════════════════════════════════════════════════════════════ */

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

/* ═══════════════════════════════════════════════════════════════════════════
   Design System Tokens
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  --primary: #002068;
  --on-primary: #ffffff;
  --primary-container: #003399;
  --on-primary-container: #8aa4ff;
  --primary-fixed: #dce1ff;
  --primary-fixed-dim: #b5c4ff;
  --secondary: #bb0021;
  --on-secondary: #ffffff;
  --secondary-container: #e8082d;
  --on-secondary-container: #fffbff;
  --error: #ba1a1a;
  --on-error: #ffffff;
  --error-container: #ffdad6;
  --on-error-container: #93000a;
  --background: #f8f9fa;
  --surface: #f8f9fa;
  --surface-container-lowest: #ffffff;
  --surface-container-low: #f3f4f5;
  --surface-container: #edeeef;
  --surface-container-high: #e7e8e9;
  --surface-container-highest: #e1e3e4;
  --on-surface: #191c1d;
  --on-surface-variant: #444653;
  --outline: #747684;
  --outline-variant: #c4c5d5;

  --amber: #F59E0B;
  --amber-light: #FEF3C7;
  --amber-dark: #92400E;
  --green: #10B981;
  --green-light: #D1FAE5;
  --green-dark: #065F46;

  --font-display: 'Outfit', system-ui, sans-serif;
  --font-body: 'Outfit', system-ui, sans-serif;

  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-pill: 9999px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --max-width: 1440px;

  --transition-fast: all 0.15s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-normal: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  font-family: var(--font-body);
  background-color: var(--background);
  color: var(--on-surface);
  line-height: 1.5;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TYPOGRAPHY CLASSES (Tailwind custom font utilities)
   ═══════════════════════════════════════════════════════════════════════════ */
.font-headline-xl { font-family: var(--font-display); font-size: 36px; font-weight: 700; line-height: 44px; letter-spacing: -0.02em; }
.font-headline-lg { font-family: var(--font-display); font-size: 28px; font-weight: 600; line-height: 36px; letter-spacing: -0.01em; }
.font-headline-md { font-family: var(--font-display); font-size: 20px; font-weight: 600; line-height: 28px; }
.font-body-lg { font-family: var(--font-body); font-size: 16px; font-weight: 400; line-height: 24px; }
.font-body-md { font-family: var(--font-body); font-size: 14px; font-weight0; line-height: 20px; }
.font-label-lg { font-family: var(--font-body); font-size: 14px; font-weight: 600; line-height: 20px; }
.font-label-sm { font-family: var(--font-body); font-size: 12px; font-weight: 500; line-height: 16px; }
.font-headline-lg-mobile { font-family: var(--font-display); font-size: 24px; font-weight: 700; line-height: 32px; }

/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */
.app-container { width: 100%; height: 100vh; }

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR NAVIGATION
   ═══════════════════════════════════════════════════════════════════════════ */
.nav-link { text-decoration: none; display: flex; }
.nav-link:hover { color: var(--primary); }
.nav-link:hover .material-symbols-outlined { color: var(--primary); }

/* ═══════════════════════════════════════════════════════════════════════════
   VIEW MANAGEMENT
   ═══════════════════════════════════════════════════════════════════════════ */
.view { display: none; }
.view.active { display: block; }
.view:not(.hidden) { display: block; }

/* ═══════════════════════════════════════════════════════════════════════════
   STATUS CHIPS / BADGES
   ═══════════════════════════════════════════════════════════════════════════ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  font-family: var(--font-body);
}
.status-badge.overdue { background: var(--error-container); color: var(--on-error-container); }
.status-badge.pending { background: var(--amber-light); color: var(--amber-dark); }
.status-badge.resolved { background: var(--green-light); color: var(--green-dark); }

/* ═══════════════════════════════════════════════════════════════════════════
   TABLE STYLES
   ═══════════════════════════════════════════════════════════════════════════ */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 8px 12px; font-size: 12px; font-weight: 500; color: var(--on-surface-variant); text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--outline-variant); background: var(--surface-container-low); }
.data-table td { padding: 8px 12px; font-size: 14px; border-bottom: 1px solid rgba(196, 197, 213, 0.5); }
.data-table tbody tr:hover { background: var(--surface-container-low); transition: background 0.15s; }
.data-table tbody tr:nth-child(even) { background: #F8F9FA; }
.data-table tbody tr:nth-child(even):hover { background: var(--surface-container-low); }

/* ═══════════════════════════════════════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════════════════════════════════════ */
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary) !important; box-shadow: 0 0 0 1px var(--primary); }

/* ═══════════════════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════════════════ */
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  background: var(--surface-container-lowest);
  border: 1px solid var(--outline-variant);
  box-shadow: var(--shadow-md);
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--on-surface);
  animation: slideInRight 0.3s ease;
  min-width: 280px;
  max-width: 400px;
}
.toast.success { border-left: 4px solid var(--green); }
.toast.error { border-left: 4px solid var(--error); }
.toast.info { border-left: 4px solid var(--primary-container); }
.toast.warning { border-left: 4px solid var(--amber); }

@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOutRight { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }

/* ═══════════════════════════════════════════════════════════════════════════
   MODAL ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */
.modal-enter { animation: modalFadeIn 0.2s ease; }
@keyframes modalFadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }

/* ═══════════════════════════════════════════════════════════════════════════
   MATERIAL SYMBOLS
   ═══════════════════════════════════════════════════════════════════════════ */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  font-size: 20px;
  vertical-align: middle;
}

/* ═══════════════════════════════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--outline-variant); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--outline); }

/* ═══════════════════════════════════════════════════════════════════════════
   TOGGLE SWITCH (Sectors Admin - Stitch Reference Style)
   ═══════════════════════════════════════════════════════════════════════════ */
.toggle-checkbox { position: absolute; width: 20px; height: 20px; z-index: 10; transition: transform 0.2s ease-in-out; }
.toggle-checkbox:checked { transform: translateX(20px); border-color: white; }
.toggle-checkbox:checked + .toggle-label { background-color: var(--primary-container); }
.toggle-label { display: block; overflow: hidden; height: 20px; border-radius: 9999px; cursor: pointer; transition: background-color 0.2s ease-in-out; }
.toggle-checkbox:not(:checked) { border-color: var(--outline-variant); }
.table-row-hover:hover { background-color: var(--surface-container-low); }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE STYLES
   ═══════════════════════════════════════════════════════════════════════════ */

/* Mobile table: horizontal scroll */
@media (max-width: 768px) {
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Stack form grids on mobile */
  .grid-cols-2 {
    grid-template-columns: 1fr !important;
  }
  
  /* Full-width modals on mobile */
  #edit-modal > div:nth-child(2),
  #user-modal > div:nth-child(2),
  #sector-modal > div:nth-child(2),
  #profile-modal > div:nth-child(2),
  #help-modal > div:nth-child(2) {
    width: calc(100vw - 2rem) !important;
    max-width: calc(100vw - 2rem) !important;
    margin: 1rem;
  }
  
  /* Stats grid on mobile */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr !important;
  }
  
  /* Hide less important columns on small screens */
  .hide-mobile {
    display: none !important;
  }
}

/* Dropdown padding improvements */
#profile-dropdown,
#notification-dropdown {
  padding: 0.5rem;
}

#profile-dropdown > div,
#notification-dropdown > div {
  border-radius: 0.5rem;
}

/* Sidebar collapsed state for tablet */
.sidebar-collapsed .nav-link span {
  display: none;
}

.sidebar-collapsed .nav-link {
  justify-content: center;
  padding: 0.75rem;
}

/* Touch-friendly tap targets */
@media (pointer: coarse) {
  .nav-link,
  button,
  .btn {
    min-height: 44px;
    min-width: 44px;
  }
  
  select,
  input,
  textarea {
    font-size: 16px !important; /* Prevents zoom on iOS */
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SECTOR DISTRIBUTION BAR
   ═══════════════════════════════════════════════════════════════════════════ */
.sector-bar-segment { height: 100%; transition: width 0.5s ease; }
.sector-bar-segment:first-child { border-radius: 9999px 0 0 9999px; }
.sector-bar-segment:last-child { border-radius: 0 9999px 9999px 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .font-headline-xl { font-size: 24px; line-height: 32px; font-weight: 700; }
  .font-headline-lg { font-size: 20px; line-height: 28px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.animate-spin { animation: spin 1s linear infinite; }

/* ═══════════════════════════════════════════════════════════════════════════
   GLOBAL LINK RESET — remove all underlines
   ═══════════════════════════════════════════════════════════════════════════ */
a {
  text-decoration: none !important;
}
a:hover {
  text-decoration: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTON DESIGN SYSTEM
   Variants:
     .btn-primary   — navy fill (primary actions: Save, Submit, Apply)
     .btn-danger    — red fill  (destructive: Delete, Deactivate)
     .btn-success   — green fill (positive: Import)
     .btn-outline   — bordered navy ghost (secondary actions)
     .btn-ghost     — text-only navy (tertiary / link-style actions)
     .btn-neutral   — bordered grey ghost (Cancel, Clear)
     .btn-icon      — icon-only circle button
   ═══════════════════════════════════════════════════════════════════════════ */

/* Shared base */
button, .btn {
  cursor: pointer;
  font-family: var(--font-body);
  transition: background-color 0.15s ease, color 0.15s ease,
              border-color 0.15s ease, box-shadow 0.15s ease,
              transform 0.1s ease, filter 0.15s ease;
}
button:active, .btn:active {
  transform: scale(0.97);
}

/* ── Primary (navy fill) ── */
.btn-primary,
#btn-save-settings,
#btn-add-user,
#btn-new-sector,
#user-modal-save,
#sector-modal-save,
#btn-save-edit,
#btn-apply-filters,
#btn-mapping-next,
#btn-import-more,
#profile-modal-edit,
#btn-accept-suggestion,
#btn-confirm-sector,
#btn-browse {
  background: linear-gradient(135deg, #002580 0%, #003399 100%) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(0, 32, 128, 0.3) !important;
}
.btn-primary:hover,
#btn-save-settings:hover,
#btn-add-user:hover,
#btn-new-sector:hover,
#user-modal-save:hover,
#sector-modal-save:hover,
#btn-save-edit:hover,
#btn-apply-filters:hover,
#btn-mapping-next:hover,
#btn-import-more:hover,
#profile-modal-edit:hover,
#btn-accept-suggestion:hover,
#btn-confirm-sector:hover,
#btn-browse:hover {
  background: linear-gradient(135deg, #001a60 0%, #002580 100%) !important;
  box-shadow: 0 4px 16px rgba(0, 32, 128, 0.45) !important;
  filter: brightness(1.05) !important;
}

/* ── Submit Call / form submit (red) — already has inline styles, reinforce ── */
#btn-submit-call,
button[type="submit"].bg-secondary,
#btn-quick-new-call,
#btn-import {
  background: linear-gradient(135deg, #cc001e 0%, #E4002B 60%, #ff1a3d 100%) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 4px 16px rgba(228, 0, 43, 0.35) !important;
}
#btn-submit-call:hover,
button[type="submit"].bg-secondary:hover,
#btn-quick-new-call:hover,
#btn-import:hover {
  filter: brightness(1.08) !important;
  box-shadow: 0 6px 24px rgba(228, 0, 43, 0.5) !important;
}

/* ── Danger (red fill — Delete, Deactivate) ── */
.btn-danger,
#btn-delete-call,
#modal-confirm {
  background: var(--error) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(186, 26, 26, 0.3) !important;
}
.btn-danger:hover,
#btn-delete-call:hover,
#modal-confirm:hover {
  background: #93000a !important;
  box-shadow: 0 4px 16px rgba(186, 26, 26, 0.5) !important;
}

/* ── Outline (bordered navy ghost) ── */
.btn-outline,
#btn-mapping-back,
#btn-validation-back,
#btn-view-dashboard,
#btn-clear-filters,
#btn-quick-bulk-upload,
#btn-quick-export,
#btn-save-draft,
#btn-export-logs,
#btn-export-dashboard,
#btn-template {
  background: transparent !important;
  color: var(--primary-container) !important;
  border: 1.5px solid var(--primary-container) !important;
  box-shadow: none !important;
}
.btn-outline:hover,
#btn-mapping-back:hover,
#btn-validation-back:hover,
#btn-view-dashboard:hover,
#btn-clear-filters:hover,
#btn-quick-bulk-upload:hover,
#btn-quick-export:hover,
#btn-save-draft:hover,
#btn-export-logs:hover,
#btn-export-dashboard:hover,
#btn-template:hover {
  background: rgba(0, 51, 153, 0.07) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  box-shadow: 0 2px 8px rgba(0, 51, 153, 0.15) !important;
}

/* ── Neutral ghost (Cancel, Clear Form, Close) ── */
.btn-neutral,
#btn-clear-form,
#user-modal-cancel,
#sector-modal-cancel,
#btn-cancel-edit,
#modal-cancel,
#profile-modal-close-btn {
  background: transparent !important;
  color: var(--on-surface-variant) !important;
  border: 1.5px solid var(--outline-variant) !important;
  box-shadow: none !important;
}
.btn-neutral:hover,
#btn-clear-form:hover,
#user-modal-cancel:hover,
#sector-modal-cancel:hover,
#btn-cancel-edit:hover,
#modal-cancel:hover,
#profile-modal-close-btn:hover {
  background: var(--surface-container-high) !important;
  color: var(--on-surface) !important;
  border-color: var(--outline) !important;
}

/* ── Icon-circle buttons (close X, prev/next) ── */
.btn-icon,
#user-modal-close,
#sector-modal-close,
#edit-modal-close,
#profile-modal-close,
#help-modal-close,
#notifications-modal-close,
#sidebar-close,
#sidebar-toggle {
  background: transparent !important;
  color: var(--on-surface-variant) !important;
  border: none !important;
}
.btn-icon:hover,
#user-modal-close:hover,
#sector-modal-close:hover,
#edit-modal-close:hover,
#profile-modal-close:hover,
#help-modal-close:hover,
#notifications-modal-close:hover,
#sidebar-close:hover,
#sidebar-toggle:hover {
  background: var(--surface-container-high) !important;
  color: var(--on-surface) !important;
}

/* ── Pagination prev/next ── */
#sectors-prev, #sectors-next,
#logs-prev, #logs-next {
  background: transparent !important;
  color: var(--on-surface-variant) !important;
  border: 1.5px solid var(--outline-variant) !important;
  border-radius: 8px !important;
  padding: 4px 6px !important;
}
#sectors-prev:hover:not(:disabled), #sectors-next:hover:not(:disabled),
#logs-prev:hover:not(:disabled), #logs-next:hover:not(:disabled) {
  background: rgba(0, 51, 153, 0.08) !important;
  color: var(--primary-container) !important;
  border-color: var(--primary-container) !important;
}

/* ── Admin tabs / notification tabs ── */
.admin-tab-btn,
#notif-tab-all,
#notif-tab-unread {
  background: transparent !important;
  transition: color 0.15s, background 0.15s, border-color 0.15s !important;
}
.admin-tab-btn:hover,
#notif-tab-all:hover,
#notif-tab-unread:hover {
  background: rgba(0, 51, 153, 0.06) !important;
  color: var(--primary) !important;
}

/* ── Filter & Advanced filter button ── */
#btn-advanced-filter {
  background: transparent !important;
  color: var(--on-surface-variant) !important;
  border: 1.5px solid var(--outline-variant) !important;
}
#btn-advanced-filter:hover {
  background: rgba(0, 51, 153, 0.07) !important;
  color: var(--primary-container) !important;
  border-color: var(--primary-container) !important;
}

/* ── Text link-style buttons ("View All", "Mark all read", "Clear all") ── */
#mark-all-read,
#view-all-notifications,
#notifications-modal-mark-all,
#notifications-modal-clear,
#btn-override-sector,
#btn-change-locked-sector {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 2px 6px !important;
  border-radius: 6px !important;
}
#mark-all-read:hover,
#view-all-notifications:hover,
#notifications-modal-mark-all:hover {
  background: rgba(0, 51, 153, 0.08) !important;
  color: var(--primary) !important;
}
#notifications-modal-clear:hover {
  background: rgba(186, 26, 26, 0.08) !important;
  color: var(--error) !important;
}

/* ── AI Suggest button ── */
#btn-suggest-action {
  background: rgba(0, 32, 128, 0.06) !important;
  color: var(--primary-container) !important;
  border: 1px solid rgba(0, 51, 153, 0.2) !important;
}
#btn-suggest-action:hover {
  background: rgba(0, 32, 128, 0.12) !important;
  border-color: var(--primary-container) !important;
}

/* ── Help link inside Help modal ── */
a.text-primary,
a[href^="mailto"] {
  color: var(--primary-container) !important;
  font-weight: 600;
}
a.text-primary:hover,
a[href^="mailto"]:hover {
  color: var(--primary) !important;
}

