/**
 * Fixit Design System - modern-fixit.css
 * Enterprise UI/UX Theme for Fixit Bug Tracking & QA System
 * Developed for fixit.a1logics.in
 */

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

:root {
  /* Color Palette - Slate & Indigo Core */
  --fx-primary: #2563eb;
  --fx-primary-hover: #1d4ed8;
  --fx-primary-light: #eff6ff;
  --fx-primary-border: #bfdbfe;
  
  --fx-secondary: #4f46e5;
  --fx-secondary-hover: #4338ca;
  
  /* Neutral Palette */
  --fx-bg-canvas: #f8fafc;
  --fx-bg-card: #ffffff;
  --fx-bg-muted: #f1f5f9;
  --fx-border: #e2e8f0;
  --fx-border-focus: #93c5fd;
  
  /* Text Palette */
  --fx-text-main: #0f172a;
  --fx-text-muted: #64748b;
  --fx-text-subtle: #94a3b8;
  --fx-text-white: #ffffff;
  
  /* Semantic Status Colors */
  --fx-status-open-text: #e11d48;
  --fx-status-open-bg: #ffe4e6;
  --fx-status-open-border: #fecdd3;
  
  --fx-status-progress-text: #d97706;
  --fx-status-progress-bg: #fef3c7;
  --fx-status-progress-border: #fde68a;
  
  --fx-status-resolved-text: #059669;
  --fx-status-resolved-bg: #d1fae5;
  --fx-status-resolved-border: #a7f3d0;
  
  --fx-status-reopen-text: #7c3aed;
  --fx-status-reopen-bg: #ede9fe;
  --fx-status-reopen-border: #ddd6fe;

  --fx-status-closed-text: #475569;
  --fx-status-closed-bg: #f1f5f9;
  --fx-status-closed-border: #cbd5e1;

  /* Sidebar Dark Theme */
  --fx-sidebar-bg: #0f172a;
  --fx-sidebar-header: #1e293b;
  --fx-sidebar-hover: #1e293b;
  --fx-sidebar-active: #2563eb;
  --fx-sidebar-text: #94a3b8;
  --fx-sidebar-text-active: #ffffff;
  --fx-sidebar-border: #1e293b;

  /* Elevations */
  --fx-shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --fx-shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --fx-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.08);
  --fx-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.08);
  --fx-shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  /* Radius */
  --fx-radius-sm: 6px;
  --fx-radius-md: 10px;
  --fx-radius-lg: 14px;
  --fx-radius-xl: 20px;
  --fx-radius-full: 9999px;

  /* Fonts */
  --fx-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Base Resets */
*, *::before, *::after {
  box-sizing: border-box;
}

body.fx-body, body {
  font-family: var(--fx-font-sans) !important;
  background-color: var(--fx-bg-canvas) !important;
  color: var(--fx-text-main) !important;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Smooth Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ==========================================================================
   App Layout: Sidebar & Topbar Shell
   ========================================================================== */
.fx-app-wrapper {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background-color: var(--fx-bg-canvas);
}

.fx-sidebar {
  width: 260px;
  background-color: var(--fx-sidebar-bg);
  color: var(--fx-sidebar-text);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--fx-sidebar-border);
  transition: width 0.25s ease, transform 0.25s ease;
  z-index: 1000;
  position: sticky;
  top: 0;
  height: 100vh;
  max-height: 100vh;
}

.fx-sidebar-brand {
  height: 70px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid var(--fx-sidebar-border);
  background-color: var(--fx-sidebar-header);
}

.fx-sidebar-brand img {
  height: 36px;
  width: auto;
  border-radius: 8px;
}

.fx-sidebar-brand .fx-brand-text {
  display: flex;
  flex-direction: column;
}

.fx-sidebar-brand .fx-brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.fx-sidebar-brand .fx-brand-tag {
  font-size: 0.7rem;
  font-weight: 600;
  color: #38bdf8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fx-sidebar-user {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: rgba(30, 41, 59, 0.5);
  border-bottom: 1px solid var(--fx-sidebar-border);
}

.fx-sidebar-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #38bdf8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #ffffff;
  font-size: 1rem;
  box-shadow: var(--fx-shadow-sm);
  flex-shrink: 0;
}

.fx-sidebar-user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fx-sidebar-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fx-sidebar-user-role {
  font-size: 0.72rem;
  color: #38bdf8;
  font-weight: 500;
}

.fx-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  list-style: none;
  margin: 0;
}

.fx-nav-heading {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 12px 14px 6px;
  margin-top: 6px;
}

.fx-nav-item {
  margin-bottom: 4px;
}

.fx-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--fx-sidebar-text) !important;
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none !important;
  border-radius: var(--fx-radius-sm);
  transition: all 0.2s ease;
}

.fx-nav-link i, .fx-nav-link svg {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
  color: #64748b;
  transition: color 0.2s ease;
}

.fx-nav-link:hover {
  background-color: var(--fx-sidebar-hover);
  color: #ffffff !important;
}

.fx-nav-link:hover i {
  color: #38bdf8;
}

.fx-nav-link.active, .fx-nav-item.active > .fx-nav-link {
  background-color: var(--fx-sidebar-active);
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.fx-nav-link.active i {
  color: #ffffff;
}

/* Sidebar Footer */
.fx-sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--fx-sidebar-border);
  background-color: var(--fx-sidebar-header);
}

.fx-btn-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background-color: rgba(239, 68, 68, 0.12);
  color: #fca5a5 !important;
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--fx-radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fx-btn-logout:hover {
  background-color: #ef4444;
  color: #ffffff !important;
  border-color: #ef4444;
}

/* Main Viewport Container */
.fx-main-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-x: hidden;
}

/* Topbar */
.fx-topbar {
  height: 70px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--fx-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  box-shadow: var(--fx-shadow-xs);
  position: sticky;
  top: 0;
  z-index: 500;
}

.fx-topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.fx-sidebar-toggle {
  background: none;
  border: none;
  color: var(--fx-text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--fx-radius-sm);
  transition: all 0.15s ease;
}

.fx-sidebar-toggle:hover {
  background-color: var(--fx-bg-muted);
  color: var(--fx-text-main);
}

.fx-breadcrumb-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fx-text-main);
  margin: 0;
}

.fx-topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.fx-last-login {
  font-size: 0.78rem;
  color: var(--fx-text-muted);
  background-color: var(--fx-bg-muted);
  padding: 6px 14px;
  border-radius: var(--fx-radius-full);
  display: flex;
  align-items: center;
  gap: 6px;
}

.fx-last-login strong {
  color: var(--fx-text-main);
}

.fx-topbar-logout {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  background-color: rgba(239, 68, 68, 0.08);
  color: #dc2626 !important;
  border: 1px solid rgba(239, 68, 68, 0.22);
  border-radius: var(--fx-radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none !important;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fx-topbar-logout:hover {
  background-color: #ef4444;
  color: #ffffff !important;
  border-color: #ef4444;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* Main Content Body */
.fx-content-area {
  flex: 1;
  padding: 28px 32px 48px;
}

/* ==========================================================================
   Card System
   ========================================================================== */
.fx-card {
  background: var(--fx-bg-card);
  border: 1px solid var(--fx-border);
  border-radius: var(--fx-radius-lg);
  box-shadow: var(--fx-shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.fx-card:hover {
  box-shadow: var(--fx-shadow-md);
  border-color: #cbd5e1;
}

.fx-card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--fx-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #ffffff;
}

.fx-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--fx-text-main);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fx-card-body {
  padding: 24px;
}

.fx-card-footer {
  padding: 14px 24px;
  background-color: var(--fx-bg-muted);
  border-top: 1px solid var(--fx-border);
}

/* ==========================================================================
   KPI / Stat Cards Grid
   ========================================================================== */
.fx-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.fx-stat-card {
  background: var(--fx-bg-card);
  border: 1px solid var(--fx-border);
  border-radius: var(--fx-radius-md);
  padding: 20px;
  box-shadow: var(--fx-shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fx-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--fx-shadow-md);
}

.fx-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--fx-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.fx-stat-icon.primary { background: #eff6ff; color: #2563eb; }
.fx-stat-icon.rose { background: #ffe4e6; color: #e11d48; }
.fx-stat-icon.amber { background: #fef3c7; color: #d97706; }
.fx-stat-icon.emerald { background: #d1fae5; color: #059669; }
.fx-stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.fx-stat-icon.slate { background: #f1f5f9; color: #475569; }

.fx-stat-info {
  display: flex;
  flex-direction: column;
}

.fx-stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fx-text-muted);
}

.fx-stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--fx-text-main);
  line-height: 1.2;
  margin-top: 2px;
}

/* ==========================================================================
   Modern Buttons
   ========================================================================== */
.fx-btn, input[type="submit"].fx-btn, input[type="button"].fx-btn, button.fx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--fx-radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none !important;
  line-height: 1.25;
}

.fx-btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

.fx-btn-primary {
  background-color: var(--fx-primary);
  color: #ffffff !important;
}
.fx-btn-primary:hover {
  background-color: var(--fx-primary-hover);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  color: #ffffff !important;
}

.fx-btn-secondary {
  background-color: #ffffff;
  border-color: var(--fx-border);
  color: var(--fx-text-main) !important;
}
.fx-btn-secondary:hover {
  background-color: var(--fx-bg-muted);
  border-color: #cbd5e1;
}

.fx-btn-success {
  background-color: #10b981;
  color: #ffffff !important;
}
.fx-btn-success:hover {
  background-color: #059669;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.fx-btn-danger {
  background-color: #ef4444;
  color: #ffffff !important;
}
.fx-btn-danger:hover {
  background-color: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.fx-btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.fx-btn-lg {
  padding: 12px 24px;
  font-size: 1rem;
  border-radius: var(--fx-radius-md);
}

/* ==========================================================================
   Form Controls & Modern Inputs
   ========================================================================== */
.fx-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.fx-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.fx-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--fx-text-main);
  margin: 0;
}

.fx-control, 
input[type="text"].fx-control, 
input[type="password"].fx-control, 
input[type="email"].fx-control, 
select.fx-control, 
textarea.fx-control {
  width: 100%;
  height: 40px;
  padding: 8px 14px;
  font-size: 0.88rem;
  font-family: var(--fx-font-sans);
  color: var(--fx-text-main);
  background-color: #ffffff;
  border: 1px solid var(--fx-border);
  border-radius: var(--fx-radius-sm);
  box-shadow: var(--fx-shadow-xs);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea.fx-control {
  height: auto;
  min-height: 90px;
}

.fx-control:focus, 
input[type="text"].fx-control:focus, 
select.fx-control:focus, 
textarea.fx-control:focus {
  border-color: var(--fx-primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Filter Toolbar */
.fx-filter-toolbar {
  background: #ffffff;
  border: 1px solid var(--fx-border);
  border-radius: var(--fx-radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  box-shadow: var(--fx-shadow-xs);
}

.fx-filter-toolbar .fx-control {
  width: auto;
  min-width: 180px;
}

/* ==========================================================================
   Data Table & ASP.NET GridView Modernization
   ========================================================================== */
.fx-table-container {
  width: 100%;
  overflow-x: auto;
  background: #ffffff;
  border: 1px solid var(--fx-border);
  border-radius: var(--fx-radius-md);
  box-shadow: var(--fx-shadow-xs);
}

.fx-table, table.fx-gridview, table.table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 0 !important;
  border: none !important;
  font-size: 0.86rem;
}

.fx-table th, table.fx-gridview th, table.table th {
  background-color: #f8fafc !important;
  color: #475569 !important;
  font-weight: 700 !important;
  font-size: 0.75rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  padding: 12px 16px !important;
  border-bottom: 1px solid var(--fx-border) !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  text-align: left;
  white-space: nowrap;
}

.fx-table td, table.fx-gridview td, table.table td {
  padding: 12px 16px !important;
  vertical-align: middle !important;
  border-bottom: 1px solid var(--fx-border) !important;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  color: var(--fx-text-main);
  transition: background-color 0.15s ease;
}

.fx-table tbody tr:hover td, table.fx-gridview tr:hover td {
  background-color: #f1f5f9 !important;
}

/* Status Badges */
.fx-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--fx-radius-full);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.fx-badge-open {
  background-color: var(--fx-status-open-bg);
  color: var(--fx-status-open-text);
  border: 1px solid var(--fx-status-open-border);
}

.fx-badge-progress {
  background-color: var(--fx-status-progress-bg);
  color: var(--fx-status-progress-text);
  border: 1px solid var(--fx-status-progress-border);
}

.fx-badge-resolved {
  background-color: var(--fx-status-resolved-bg);
  color: var(--fx-status-resolved-text);
  border: 1px solid var(--fx-status-resolved-border);
}

.fx-badge-reopen {
  background-color: var(--fx-status-reopen-bg);
  color: var(--fx-status-reopen-text);
  border: 1px solid var(--fx-status-reopen-border);
}

.fx-badge-closed {
  background-color: var(--fx-status-closed-bg);
  color: var(--fx-status-closed-text);
  border: 1px solid var(--fx-status-closed-border);
}

/* ==========================================================================
   Modern File Upload Dropzone
   ========================================================================== */
.fx-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--fx-radius-md);
  padding: 24px;
  text-align: center;
  background-color: #f8fafc;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.fx-dropzone:hover {
  border-color: var(--fx-primary);
  background-color: #eff6ff;
}

.fx-dropzone i {
  font-size: 2rem;
  color: #94a3b8;
  margin-bottom: 8px;
}

.fx-preview-thumb {
  max-width: 140px;
  max-height: 140px;
  border-radius: var(--fx-radius-sm);
  border: 1px solid var(--fx-border);
  box-shadow: var(--fx-shadow-sm);
  object-fit: cover;
  margin-top: 8px;
}

/* ==========================================================================
   SaaS Public Portal & Auth Screens
   ========================================================================== */
.fx-auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  background: radial-gradient(circle at 10% 20%, rgb(240, 244, 255) 0%, rgb(248, 250, 252) 90%);
}

.fx-auth-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: var(--fx-radius-xl);
  box-shadow: var(--fx-shadow-xl);
  border: 1px solid var(--fx-border);
  padding: 36px 32px;
}

.fx-portal-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  display: flex;
  flex-direction: column;
  color: #ffffff;
}

.fx-portal-header {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.fx-portal-hero {
  max-width: 1100px;
  margin: 48px auto;
  text-align: center;
  padding: 0 24px;
}

.fx-portal-roles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  max-width: 1100px;
  margin: 32px auto 64px;
  padding: 0 24px;
  width: 100%;
}

.fx-role-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--fx-radius-lg);
  padding: 36px 28px;
  text-align: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fx-role-card:hover {
  transform: translateY(-6px);
  background: rgba(255, 255, 255, 0.08);
  border-color: #38bdf8;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.fx-role-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 20px;
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
  .fx-sidebar {
    position: fixed;
    left: -260px;
    height: 100vh;
  }
  .fx-sidebar.open {
    left: 0;
  }
  .fx-topbar {
    padding: 0 16px;
  }
  .fx-content-area {
    padding: 20px 16px;
  }
}
