/* ==========================================================================
   FixFlow Modern Design System & Stylesheet
   Designed for clean, accessible, mobile-first responsive UX
   ========================================================================== */

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

:root {
  /* Brand Palette */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-glow: rgba(79, 70, 229, 0.25);
  
  /* Neutral / Base */
  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #24344d;
  --bg-input: #0f172a;
  --border-color: #334155;
  --border-focus: #6366f1;
  
  /* Text */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-sub: #cbd5e1;
  
  /* Status Colors */
  --status-open: #3b82f6;
  --status-open-bg: rgba(59, 130, 246, 0.15);
  --status-assigned: #8b5cf6;
  --status-assigned-bg: rgba(139, 92, 246, 0.15);
  --status-in-progress: #f59e0b;
  --status-in-progress-bg: rgba(245, 158, 11, 0.15);
  --status-resolved: #10b981;
  --status-resolved-bg: rgba(16, 185, 129, 0.15);
  
  /* Priority Colors */
  --priority-low: #10b981;
  --priority-low-bg: rgba(16, 185, 129, 0.15);
  --priority-medium: #f59e0b;
  --priority-medium-bg: rgba(245, 158, 11, 0.15);
  --priority-high: #f97316;
  --priority-high-bg: rgba(249, 115, 22, 0.15);
  --priority-critical: #ef4444;
  --priority-critical-bg: rgba(239, 68, 68, 0.15);

  /* Radius & Shadows */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.35);

  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Core */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.25;
}

a {
  color: #818cf8;
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: #a5b4fc;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.auth-container {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: radial-gradient(circle at top, #1e1b4b 0%, #0f172a 70%);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(8px);
}

/* Navbar */
.navbar {
  background: rgba(30, 41, 59, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.85rem 0;
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.brand-logo span.badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  background: var(--primary);
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

/* Status Badges */
.badge-status-open {
  background: var(--status-open-bg);
  color: var(--status-open);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-status-assigned {
  background: var(--status-assigned-bg);
  color: var(--status-assigned);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-status-in-progress {
  background: var(--status-in-progress-bg);
  color: var(--status-in-progress);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-status-resolved {
  background: var(--status-resolved-bg);
  color: var(--status-resolved);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Priority Badges */
.badge-priority-low {
  background: var(--priority-low-bg);
  color: var(--priority-low);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-priority-medium {
  background: var(--priority-medium-bg);
  color: var(--priority-medium);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-priority-high {
  background: var(--priority-high-bg);
  color: var(--priority-high);
  border: 1px solid rgba(249, 115, 22, 0.3);
}

.badge-priority-critical {
  background: var(--priority-critical-bg);
  color: var(--priority-critical);
  border: 1px solid rgba(239, 68, 68, 0.3);
  animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0); }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px var(--primary-glow);
  color: #fff;
}

.btn-secondary {
  background: #334155;
  color: var(--text-main);
  border-color: #475569;
}

.btn-secondary:hover {
  background: #475569;
  color: #fff;
}

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-sub);
}

.btn-outline:hover {
  border-color: #64748b;
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.btn-danger {
  background: #dc2626;
  color: #fff;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

/* Form Controls */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
  color: var(--text-sub);
}

.form-control {
  width: 100%;
  padding: 0.7rem 0.9rem;
  font-size: 0.95rem;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

textarea.form-control {
  resize: vertical;
  min-height: 90px;
}

/* Cards & Stats */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stat-card .stat-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.table th {
  background: #1e293b;
  padding: 0.85rem 1rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-sub);
}

.table tbody tr:hover {
  background-color: var(--bg-card-hover);
  cursor: pointer;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: #1e293b;
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 280px;
  animation: slide-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-success { border-left: 4px solid var(--status-resolved); }
.toast-error { border-left: 4px solid var(--priority-critical); }
.toast-info { border-left: 4px solid var(--status-open); }

@keyframes slide-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Loading Spinner */
.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .nav-content {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* In-App Notifications Component */
.notif-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.notif-bell-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: var(--radius-full);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  font-size: 1.1rem;
  transition: var(--transition);
  padding: 0;
}

.notif-bell-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--primary);
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-main);
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  max-width: 90vw;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slide-in-down 0.15s ease-out;
}

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

.notif-header {
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notif-header h4 {
  font-size: 0.88rem;
  margin: 0;
  color: #fff;
}

.notif-list {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.notif-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: var(--transition);
  cursor: pointer;
}

.notif-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.notif-item.unread {
  background: rgba(99, 102, 241, 0.08);
  border-left: 3px solid var(--primary);
}

.notif-msg {
  font-size: 0.85rem;
  color: #f1f5f9;
  line-height: 1.4;
  word-break: break-word;
}

.notif-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.notif-empty {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
