/*
  DocElixir SaaS Redesign - Main Stylesheet
  Focus: Modern, Premium, Vibrant, Glassmorphism, Responsive
*/

:root {
  /* Premium Color Palette */
  --primary-color: #6366f1; /* Indigo 500 */
  --primary-hover: #4f46e5; /* Indigo 600 */
  --primary-light: #e0e7ff; /* Indigo 100 */
  --secondary-color: #14b8a6; /* Teal 500 */
  --secondary-hover: #0d9488; /* Teal 600 */
  --secondary-light: #ccfbf1; /* Teal 100 */
  
  --bg-color: #f8fafc; /* Slate 50 */
  --surface-color: #ffffff; /* White */
  
  --text-main: #0f172a; /* Slate 900 */
  --text-muted: #64748b; /* Slate 500 */
  --text-light: #94a3b8; /* Slate 400 */
  
  --border-color: #e2e8f0; /* Slate 200 */
  --border-color-light: #f1f5f9; /* Slate 100 */
  
  --danger-color: #ef4444; /* Red 500 */
  --danger-light: #fee2e2; /* Red 100 */
  --success-color: #10b981; /* Emerald 500 */
  --success-light: #d1fae5; /* Emerald 100 */
  --warning-color: #f59e0b; /* Amber 500 */
  --warning-light: #fef3c7; /* Amber 100 */

  /* Glassmorphism / Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
  
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-blur: blur(10px);

  /* Layout */
  --sidebar-width: 280px;
  --navbar-height: 70px;
  --border-radius-sm: 0.375rem;
  --border-radius: 0.75rem;
  --border-radius-lg: 1.25rem;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Styles */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-main);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-hover);
}

/* Utilities */
.text-muted { color: var(--text-muted) !important; }
.text-primary { color: var(--primary-color) !important; }
.text-secondary { color: var(--secondary-color) !important; }
.text-success { color: var(--success-color) !important; }
.text-danger { color: var(--danger-color) !important; }
.text-warning { color: var(--warning-color) !important; }

.bg-glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
}

.shadow-soft {
  box-shadow: var(--shadow-md);
}

.shadow-glow {
  box-shadow: var(--shadow-glow);
}

/* Layout - App Shell */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--surface-color);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 1000;
  transition: transform var(--transition);
}

.sidebar-header {
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border-color-light);
}

.sidebar-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-color);
  letter-spacing: -0.05em;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-nav {
  flex: 1;
  padding: 1.5rem 1rem;
  overflow-y: auto;
}

.nav-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 0.1em;
  margin: 1.5rem 0 0.5rem 1rem;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  margin-bottom: 0.25rem;
  border-radius: var(--border-radius);
  color: var(--text-muted);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.nav-item i {
  margin-right: 0.75rem;
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
}

.nav-item:hover {
  background-color: var(--border-color-light);
  color: var(--text-main);
  transform: translateX(4px);
}

.nav-item.active {
  background-color: var(--primary-light);
  color: var(--primary-color);
  font-weight: 600;
}

/* Main Content */
.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-header {
  height: var(--navbar-height);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 900;
}

.app-content {
  padding: 2rem;
  flex: 1;
}

/* Cards */
.saas-card {
  background: var(--surface-color);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.stat-card {
  display: flex;
  align-items: center;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-right: 1rem;
}

.stat-icon.primary { background: var(--primary-light); color: var(--primary-color); }
.stat-icon.success { background: var(--success-light); color: var(--success-color); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning-color); }
.stat-icon.danger { background: var(--danger-light); color: var(--danger-color); }

.stat-details h4 {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-details p {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Buttons */
.btn-saas {
  border-radius: var(--border-radius);
  font-weight: 600;
  padding: 0.625rem 1.25rem;
  transition: all var(--transition-fast);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary-saas {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
}

.btn-primary-saas:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.23);
  color: white;
}

.btn-secondary-saas {
  background: var(--surface-color);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary-saas:hover {
  background: var(--border-color-light);
}

/* Forms */
.form-control-saas {
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  padding: 0.75rem 1rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  background-color: var(--bg-color);
}

.form-control-saas:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
  outline: none;
  background-color: var(--surface-color);
}

/* Custom Input Group */
.input-group-saas {
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  background-color: var(--bg-color);
  display: flex;
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-group-saas:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px var(--primary-light);
  background-color: var(--surface-color);
}

.input-group-saas .input-group-text {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  padding-right: 0.5rem;
}

.input-group-saas .form-control-saas {
  border: none;
  background: transparent;
  padding-left: 0;
  box-shadow: none;
}

.input-group-saas .form-control-saas:focus {
  box-shadow: none;
}

.form-label {
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

/* Badges */
.badge-saas {
  padding: 0.35em 0.65em;
  font-size: 0.75em;
  font-weight: 600;
  border-radius: 9999px;
}

.badge-success { background: var(--success-light); color: var(--success-color); }
.badge-warning { background: var(--warning-light); color: var(--warning-color); }
.badge-danger { background: var(--danger-light); color: var(--danger-color); }
.badge-primary { background: var(--primary-light); color: var(--primary-color); }

/* Tables */
.table-saas {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table-saas th {
  background-color: var(--bg-color);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  border-top: 1px solid var(--border-color);
}

.table-saas td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color-light);
  vertical-align: middle;
}

.table-saas tbody tr:hover td {
  background-color: var(--bg-color);
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

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

/* Animations */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-slide-up {
  animation: slideUp 0.4s ease forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* Responsive */
@media (max-width: 992px) {
  .app-sidebar {
    transform: translateX(-100%);
  }
  .app-sidebar.show {
    transform: translateX(0);
  }
  .app-main {
    margin-left: 0;
  }
}
