/* BrassHelm Kanban - Global Styles */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  letter-spacing: -0.04em !important;
}

:root {
  /* BrassHelm Colors */
  --primary: #667eea;
  --primary-dark: #5568d3;
  --secondary: #764ba2;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;

  /* Grays */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;

  /* Borders */
  --border-radius: 8px;
  --border-radius-sm: 4px;
  --border-radius-lg: 12px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body {
  font-family: 'SF UI Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--gray-900);
  background: linear-gradient(to bottom right, #312e81, #581c87, #831843);
  background-attachment: fixed;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Auth Loading */
#auth-loading {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  position: relative;
}

#auth-loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

#auth-loading > * {
  position: relative;
  z-index: 1;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1rem;
}

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

/* Buttons */
.btn {
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.btn-secondary:active {
  transform: translateY(0) scale(0.98);
}

.btn-text {
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  padding: 0.25rem 0.5rem;
}

.btn-text:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

/* Inputs - Glassmorphism */
input[type="text"],
input[type="search"],
input[type="email"],
input[type="tel"],
input[type="date"],
select,
textarea {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  font-size: 14px;
  color: white;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
}

input::placeholder,
select::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

/* Select dropdown options */
select option {
  background: #1f2937;
  color: white;
  padding: 8px;
}

/* Badges - Glassmorphism */
.stat-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ====== CLIENT SELECTOR DROPDOWN ====== */
.client-selector-wrapper {
  /* Start: Absolutely positioned, out of layout flow - NO JUMP */
  position: absolute;
  left: 20px;
  top: 20px;
  width: 0;
  min-width: 0;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-width 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease 0.5s;
}

.client-selector-wrapper.in-flow {
  position: relative;
  left: auto;
  top: auto;
}

.client-selector-wrapper.expanding {
  max-width: 250px;
  min-width: 250px;
}

.client-selector-wrapper.visible {
  opacity: 1;
}

.client-selector-wrapper.animation-complete {
  overflow: visible;
}

.client-selector-button {
  width: 250px;
  padding: 12px 40px 12px 16px;
  border: 2px solid #667eea;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  background: white;
  color: #667eea;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.client-selector-button::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 20px;
  background: linear-gradient(to right, rgba(255,255,255,0.8), transparent);
  border-radius: 6px 0 0 6px;
  pointer-events: none;
  z-index: 1;
}

.client-selector-button:hover {
  background: #f8f9ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.client-selector-button::after {
  content: '▼';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  transition: transform 0.3s;
}

.client-selector-button.open::after {
  transform: translateY(-50%) rotate(180deg);
}

.client-selector-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 250px;
  background: white;
  border: 2px solid #667eea;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
  display: none;
  z-index: 100;
  overflow: hidden;
}

.client-selector-dropdown.open {
  display: block;
  animation: dropdownSlideIn 0.2s ease-out;
}

@keyframes dropdownSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.client-selector-search {
  padding: 12px;
  border-bottom: 1px solid #e0e0e0;
  position: sticky;
  top: 0;
  background: white;
  z-index: 2;
}

.client-selector-search input {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.client-selector-search input:focus {
  outline: none;
  border-color: #667eea;
}

.client-selector-list {
  max-height: 280px;
  overflow-y: auto;
  position: relative;
}

.client-selector-list::before {
  content: '';
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(to bottom, white 0%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

.client-selector-list::after {
  content: '';
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(to top, white 0%, transparent 100%);
  pointer-events: none;
  z-index: 1;
}

.client-selector-option {
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 15px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

.client-selector-option:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.client-selector-option.selected {
  background: #f8f9ff;
  color: #667eea;
  font-weight: 600;
}

.client-selector-option.hidden {
  display: none;
}

.client-selector-no-results {
  padding: 20px;
  text-align: center;
  color: #999;
  font-size: 14px;
  display: none;
}

.client-selector-no-results.show {
  display: block;
}

/* Custom scrollbar for client selector */
.client-selector-list::-webkit-scrollbar { width: 6px; }
.client-selector-list::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
.client-selector-list::-webkit-scrollbar-thumb { background: #667eea; border-radius: 10px; }
.client-selector-list::-webkit-scrollbar-thumb:hover { background: #764ba2; }

/* SVG Icons in client selector */
.svg-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
