/* ==========================================================================
   Skill Management System - Modern UI Styles
   ========================================================================== */

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: #f8fafc;
  color: #1e293b;
}

.font-gu {
  font-family: 'Noto Sans Gujarati', 'Inter', system-ui, sans-serif;
}

/* Explicit SVG Icon Sizing & Resets */
svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

svg.w-3\.5, svg.w-3\\.5 { width: 0.875rem !important; height: 0.875rem !important; }
svg.w-4 { width: 1rem !important; height: 1rem !important; }
svg.w-5 { width: 1.25rem !important; height: 1.25rem !important; }
svg.w-6 { width: 1.5rem !important; height: 1.5rem !important; }
svg.w-7 { width: 1.75rem !important; height: 1.75rem !important; }
svg.w-8 { width: 2rem !important; height: 2rem !important; }

svg.h-3\.5, svg.h-3\\.5 { height: 0.875rem !important; }
svg.h-4 { height: 1rem !important; }
svg.h-5 { height: 1.25rem !important; }
svg.h-6 { height: 1.5rem !important; }
svg.h-7 { height: 1.75rem !important; }
svg.h-8 { height: 2rem !important; }

/* Animations */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.animate-scaleIn {
  animation: scaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-shake {
  animation: shake 0.4s ease-in-out forwards;
}

/* Navigation link active states */
.nav-link {
  color: #94a3b8;
  display: flex;
  align-items: center;
  text-decoration: none;
  font-weight: 500;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.nav-link.active {
  background-color: #4f46e5;
  color: #ffffff;
}

.nav-sublink {
  color: #94a3b8;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.nav-sublink:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.03);
}

.nav-sublink.active {
  color: #818cf8;
  font-weight: 600;
  background-color: rgba(79, 70, 229, 0.15);
}

/* Table styles */
.data-table-container {
  background: #ffffff;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: 0.8125rem;
}

.data-table thead th {
  background-color: #f8fafc;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
}

.data-table tbody td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  color: #334155;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background-color: #f8fafc;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1;
}

.badge-indigo { background-color: #eef2ff; color: #4338ca; }
.badge-emerald { background-color: #ecfdf5; color: #047857; }
.badge-rose { background-color: #fff1f2; color: #be123c; }
.badge-amber { background-color: #fffbeb; color: #b45309; }
.badge-cyan { background-color: #ecfeff; color: #0e7490; }
.badge-purple { background-color: #faf5ff; color: #7e22ce; }
.badge-slate { background-color: #f1f5f9; color: #475569; }

/* Dynamic Topic Color Badges */
.badge-color-indigo { background-color: #eef2ff; color: #4338ca; border: 1px solid #c7d2fe; }
.badge-color-blue { background-color: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.badge-color-cyan { background-color: #ecfeff; color: #0e7490; border: 1px solid #a5f3fc; }
.badge-color-teal { background-color: #f0fdf4; color: #0f766e; border: 1px solid #99f6e4; }
.badge-color-emerald { background-color: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.badge-color-green { background-color: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.badge-color-amber { background-color: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.badge-color-orange { background-color: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.badge-color-rose { background-color: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.badge-color-red { background-color: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.badge-color-purple { background-color: #faf5ff; color: #7e22ce; border: 1px solid #e9d5ff; }
.badge-color-violet { background-color: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; }
.badge-color-pink { background-color: #fdf2f8; color: #be185d; border: 1px solid #fbcfe8; }
.badge-color-slate { background-color: #f8fafc; color: #334155; border: 1px solid #e2e8f0; }

/* Buttons */
.btn-action {
  padding: 0.35rem 0.5rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  transition: all 0.15s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-action-view {
  background-color: #f8fafc;
  color: #475569;
  border-color: #e2e8f0;
}
.btn-action-view:hover {
  background-color: #f1f5f9;
  color: #1e293b;
}

.btn-action-edit {
  background-color: #eef2ff;
  color: #4f46e5;
}
.btn-action-edit:hover {
  background-color: #e0e7ff;
}

.btn-action-delete {
  background-color: #fff1f2;
  color: #e11d48;
}
.btn-action-delete:hover {
  background-color: #ffe4e6;
}

/* Stat Cards */
.stat-card {
  background: #ffffff;
  border-radius: 1rem;
  padding: 1.25rem;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

/* Form Styles */
input, select, textarea {
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* Toast Styles */
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1px solid #e2e8f0;
  animation: scaleIn 0.2s ease forwards;
  max-width: 24rem;
}

.toast-success { border-left: 4px solid #10b981; }
.toast-error { border-left: 4px solid #ef4444; }
.toast-info { border-left: 4px solid #3b82f6; }
.toast-warning { border-left: 4px solid #f59e0b; }

/* Utilities & Structural Resets */
.cursor-pointer { cursor: pointer; }
.hidden { display: none !important; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1 1 0%; }
.shrink-0 { flex-shrink: 0; }
.grid { display: grid; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.w-full { width: 100%; }
.max-w-md { max-width: 28rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }
.shadow-sm, .shadow-xs { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }

/* ==========================================================================
   Full-Height Rich HTML Content Rendering for Reports & Dossiers
   ========================================================================== */
.report-rich-html {
  width: 100%;
  font-family: 'Noto Sans Gujarati', 'Inter', system-ui, sans-serif;
  font-size: 0.8125rem;
  line-height: 1.65;
  color: #1e293b;
  word-break: break-word;
  overflow-wrap: break-word;
  overflow: visible !important;
  max-height: none !important;
}

.report-rich-html * {
  font-size: inherit !important;
  line-height: 1.6 !important;
  white-space: normal !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.report-rich-html p {
  margin-top: 0.25rem !important;
  margin-bottom: 0.5rem !important;
}

.report-rich-html p:last-child {
  margin-bottom: 0 !important;
}

.report-rich-html ul {
  list-style-type: disc !important;
  padding-inline-start: 1.5rem !important;
  margin-left: 0 !important;
  margin-bottom: 0.5rem !important;
}

.report-rich-html ol {
  list-style-type: decimal !important;
  padding-inline-start: 1.5rem !important;
  margin-left: 0 !important;
  margin-bottom: 0.5rem !important;
}

.report-rich-html li {
  margin-bottom: 0.25rem !important;
}

.report-rich-html li p {
  margin: 0 !important;
  display: inline !important;
}

.report-rich-html h1, .report-rich-html h2, .report-rich-html h3, .report-rich-html h4 {
  font-weight: 700 !important;
  margin-top: 0.75rem !important;
  margin-bottom: 0.35rem !important;
  color: #0f172a !important;
}

.report-rich-html h3 { font-size: 0.95rem !important; }
.report-rich-html h4 { font-size: 0.875rem !important; }

.report-rich-html blockquote {
  border-left: 3px solid #6366f1 !important;
  padding-left: 0.75rem !important;
  font-style: italic !important;
  color: #475569 !important;
  margin: 0.5rem 0 !important;
}

.report-rich-html table {
  width: 100% !important;
  margin: 0.5rem 0 !important;
  border-collapse: collapse !important;
}

.report-rich-html th, .report-rich-html td {
  border: 1px solid #cbd5e1 !important;
  padding: 4px 8px !important;
}

/* ==========================================================================
   Print & PDF Generation Optimization Styles
   ========================================================================== */
@media print {
  /* Hide unnecessary UI elements during printing/PDF export */
  aside,
  header,
  #loginScreen,
  #toastContainer,
  .no-print,
  #reportFilterBar,
  #reportActionsBar,
  #reportTabsNav {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #0f172a !important;
    font-size: 11pt !important;
  }

  #appContainer, #mainContent, #printableReportArea {
    overflow: visible !important;
    height: auto !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
  }

  .print-page-break {
    page-break-after: always;
    break-after: page;
  }

  .print-card-avoid-break {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .report-rich-html {
    font-size: 10.5pt !important;
    line-height: 1.5 !important;
    overflow: visible !important;
    max-height: none !important;
  }

  /* Force background colors and borders in PDF */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Clean print borders */
  table {
    border-collapse: collapse !important;
    width: 100% !important;
  }

  th, td {
    border: 1px solid #cbd5e1 !important;
    padding: 6px 8px !important;
  }

  th {
    background-color: #f1f5f9 !important;
  }
}

/* ==========================================================================
   Mobile-First Responsive Layout & Touch Optimizations
   ========================================================================== */

html, body {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Touch-friendly horizontal scrolling containers */
.touch-scroll-x,
.overflow-x-auto {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: thin;
}

.touch-scroll-x::-webkit-scrollbar,
.overflow-x-auto::-webkit-scrollbar {
  height: 5px;
}

.touch-scroll-x::-webkit-scrollbar-thumb,
.overflow-x-auto::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* Mobile Off-Canvas Sidebar Drawer */
@media (max-width: 1023px) {
  #sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    z-index: 50 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
  }

  #sidebar.sidebar-open {
    transform: translateX(0) !important;
  }

  #sidebarBackdrop {
    transition: opacity 0.28s ease;
  }

  #sidebarBackdrop.active {
    display: block !important;
    opacity: 1 !important;
  }
}

@media (min-width: 1024px) {
  #sidebar {
    position: static !important;
    transform: translateX(0) !important;
  }

  #sidebar.-ml-64 {
    margin-left: -16rem !important;
  }

  #sidebarBackdrop {
    display: none !important;
  }
}

/* Mobile Screens & Short Viewports Form, Modal & Component Adjustments */
@media (max-width: 768px), (max-height: 768px) {
  /* Modals adaptive sizing: ensure full vertical visibility and internal scroll */
  [id$="Modal"] {
    align-items: flex-start !important;
    padding: 0.5rem !important;
  }

  [id$="Modal"] > div {
    width: calc(100vw - 1rem) !important;
    max-width: calc(100vw - 1rem) !important;
    margin: 0 auto !important;
    padding: 1rem !important;
    max-height: calc(100vh - 1rem) !important;
    border-radius: 1rem !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }

  [id$="Modal"] form {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 0% !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  [id$="Modal"] .overflow-y-auto {
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain;
  }
}

@media (max-width: 640px) {
  /* Touch buttons min tap target */
  .btn-action {
    min-height: 38px;
    min-width: 38px;
    padding: 0.4rem;
  }

  /* Prevent mobile form auto-zoom by keeping inputs at >=14px */
  input[type="text"],
  input[type="password"],
  input[type="email"],
  input[type="number"],
  select,
  textarea {
    font-size: 14px !important;
    min-height: 40px;
  }

  /* Stat cards compact view */
  .stat-card {
    padding: 0.75rem 0.875rem !important;
    border-radius: 0.875rem !important;
  }

  .stat-card .text-2xl {
    font-size: 1.35rem !important;
  }

  /* Table padding */
  .data-table th,
  .data-table td {
    padding: 0.5rem 0.6rem !important;
    font-size: 0.75rem !important;
  }

  /* Mobile Toast positioning */
  #toastContainer {
    left: 1rem !important;
    right: 1rem !important;
    bottom: 1rem !important;
  }

  .toast {
    max-width: 100% !important;
    width: 100% !important;
  }
}

/* ==========================================================================
   Quill.js Rich Text Editor Integration & Gujarati Typography
   ========================================================================== */
.ql-toolbar.ql-snow {
  border-top-left-radius: 0.75rem !important;
  border-top-right-radius: 0.75rem !important;
  border-color: #cbd5e1 !important;
  background-color: #f8fafc !important;
  padding: 0.5rem !important;
}

.ql-container.ql-snow {
  border-bottom-left-radius: 0.75rem !important;
  border-bottom-right-radius: 0.75rem !important;
  border-color: #cbd5e1 !important;
  font-family: 'Noto Sans Gujarati', Inter, system-ui, sans-serif !important;
  font-size: 0.875rem !important;
  background-color: #ffffff !important;
}

.ql-editor {
  min-height: 160px;
  font-family: 'Noto Sans Gujarati', Inter, system-ui, sans-serif !important;
  line-height: 1.6 !important;
  color: #1e293b !important;
}

.ql-editor.ql-blank::before {
  color: #94a3b8 !important;
  font-style: normal !important;
  font-family: 'Noto Sans Gujarati', Inter, system-ui, sans-serif !important;
}

.ql-snow .ql-picker {
  font-size: 0.75rem !important;
}

/* ==========================================================================
   SVG & Image Transparency Checkerboard & Vector Lightbox
   ========================================================================== */
.bg-checkerboard {
  background-color: #ffffff;
  background-image: linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
                    linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
                    linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

.bg-preview-dark {
  background-color: #0f172a !important;
  background-image: none !important;
}

.bg-preview-white {
  background-color: #ffffff !important;
  background-image: none !important;
}


