/* Mogul Machine - Premium Apple-Level Design */

:root {
  /* Dynamic CSS Variables - Controlled by Settings */
  --primary: #0058ff;
  --primary-dark: #0047cc;
  --success: #03ffe9;
  --danger: #ff4444;
  --warning: #ffeb00;
  --accent-cyan: #03ffe9;
  --accent-yellow: #ffeb00;
  --accent-teal: #27adce;
  --accent-blue: #0058ff;
  
  /* Monochromatic Off-White Palette */
  --bg-primary: #fafafa;
  --bg-secondary: #f5f5f5;
  --bg-tertiary: #f0f0f0;
  --surface: #ffffff;
  --surface-hover: #f8f8f8;
  
  /* Text Colors */
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --text-tertiary: #999999;
  --text-muted: #bbbbbb;
  
  /* Borders */
  --border-light: rgba(0, 0, 0, 0.06);
  --border-medium: rgba(0, 0, 0, 0.1);
  --border-strong: rgba(0, 0, 0, 0.15);
  
  /* Shadows - Apple Style */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 24px 80px rgba(0, 0, 0, 0.16);
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.47059;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Animated Gradient Keyframes */
@keyframes gradientFlow {
  0% { background-position: 0% 50%; }
  25% { background-position: 50% 50%; }
  50% { background-position: 100% 50%; }
  75% { background-position: 50% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes shimmer {
  0% { opacity: 0.8; }
  50% { opacity: 1; }
  100% { opacity: 0.8; }
}

/* Login Screen - Glassmorphism */
.login-box {
  max-width: 420px;
  margin: 120px auto;
  padding: 48px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.login-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-yellow), var(--accent-teal), var(--accent-blue), var(--accent-cyan));
  background-size: 300% 100%;
  animation: gradientFlow 4s ease infinite;
}

.logo-container {
  margin-bottom: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-container svg {
  max-width: 200px;
  max-height: 60px;
}

.login-box h1 {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.login-box h2 {
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-weight: 400;
}

.login-box input {
  width: 100%;
  padding: 16px 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-size: 17px;
  background: var(--bg-primary);
  transition: all var(--transition-fast);
  outline: none;
}

.login-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 88, 255, 0.1);
}

.login-box button {
  width: 100%;
  padding: 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-top: 8px;
}

.login-box button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.error {
  color: var(--danger);
  margin-top: 16px;
  font-size: 14px;
}

/* Header & Navigation - Premium Black */
header {
  background: #000000;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 32px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

.logo-header {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-header svg {
  max-height: 32px;
  max-width: 180px;
}

.logo-header h1 {
  font-size: 22px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.1em;
}

/* Animated Gradient Border */
.nav-border {
  height: 3px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-yellow), var(--accent-teal), var(--accent-blue), var(--accent-cyan));
  background-size: 300% 100%;
  animation: gradientFlow 6s ease infinite;
}

/* Navigation */
nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  padding: 8px 32px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  overflow-x: auto;
  scrollbar-width: none;
}

nav::-webkit-scrollbar {
  display: none;
}

.nav-links {
  display: flex;
  gap: 4px;
  margin-right: 16px;
}

.nav-btn {
  padding: 10px 20px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.nav-btn.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
}

/* Hamburger Menu */
.hamburger-menu {
  position: relative;
}

.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.hamburger-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.hamburger-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: #1a1a1a;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  padding: 8px;
  z-index: 200;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.dropdown-menu.hidden {
  display: none;
}

.dropdown-item {
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  text-align: left;
  transition: all var(--transition-fast);
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.dropdown-item.logout {
  color: var(--danger);
}

.dropdown-item.logout:hover {
  background: rgba(255, 68, 68, 0.15);
}

/* Main Content */
main {
  max-width: 1600px;
  margin: 0 auto;
  padding: 32px;
}

/* Section Headers */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.section-header h2 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.filters {
  display: flex;
  gap: 12px;
  align-items: center;
}

.filters select {
  padding: 10px 16px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-size: 14px;
  background: var(--surface);
  cursor: pointer;
  outline: none;
  transition: all var(--transition-fast);
}

.filters select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 88, 255, 0.1);
}

/* Premium Buttons */
.btn-primary {
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  padding: 10px 20px;
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: var(--border-strong);
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #00d4c8);
  color: #000;
  font-weight: 600;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-small {
  padding: 6px 12px;
  font-size: 12px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  transition: all var(--transition-fast);
}

/* Lists & Cards - Premium Glass Effect */
.list-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.lead-card, .ae-card, .partner-card {
  background: var(--surface);
  padding: 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: all var(--transition-base);
  cursor: pointer;
}

.lead-card:hover, .ae-card:hover, .partner-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-medium);
}

.lead-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.lead-header h4 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* Status Badges - Premium */
.status-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-new { background: var(--bg-tertiary); color: var(--text-secondary); }
.status-interested { background: rgba(0, 88, 255, 0.1); color: var(--primary); }
.status-qualified { background: rgba(3, 255, 233, 0.15); color: #008b8b; }
.status-assigned { background: rgba(255, 235, 0, 0.15); color: #b8860b; }
.status-accepted { background: rgba(3, 255, 233, 0.2); color: #008b8b; }
.status-nurturing { background: rgba(39, 173, 206, 0.1); color: var(--accent-teal); }
.status-call_booked { background: rgba(255, 68, 68, 0.1); color: var(--danger); }
.status-contract_sent { background: rgba(39, 173, 206, 0.15); color: var(--accent-teal); }
.status-contract_signed { background: rgba(39, 173, 206, 0.2); color: var(--accent-teal); }
.status-payment_received { background: rgba(3, 255, 233, 0.25); color: #006666; }
.status-won { background: linear-gradient(135deg, var(--success), #00d4c8); color: #000; }
.status-lost { background: linear-gradient(135deg, var(--danger), #ff6b6b); color: white; }
.status-available { background: linear-gradient(135deg, var(--warning), #ffd700); color: #000; }

.lead-info p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lead-actions {
  margin-top: 16px;
  display: flex;
  gap: 8px;
}

/* Modals - Premium Overlay */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: var(--surface);
  padding: 32px;
  border-radius: var(--radius-xl);
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-xl);
}

.modal-content.large {
  max-width: 900px;
}

.modal .close {
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 28px;
  cursor: pointer;
  color: var(--text-tertiary);
  transition: color var(--transition-fast);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal .close:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

/* Lead Detail View */
.lead-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin: 24px 0;
}

.detail-section {
  background: var(--bg-secondary);
  padding: 20px;
  border-radius: var(--radius-md);
}

.detail-section h3 {
  font-size: 13px;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 16px;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.detail-section p {
  margin-bottom: 10px;
  font-size: 15px;
}

.lead-actions-bar {
  margin: 20px 0;
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.lead-actions-bar select {
  padding: 10px 16px;
  font-size: 15px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-medium);
  outline: none;
}

/* Forms - Premium Inputs */
form input, form select, form textarea {
  width: 100%;
  padding: 14px 18px;
  margin-bottom: 16px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-size: 15px;
  background: var(--bg-primary);
  transition: all var(--transition-fast);
  outline: none;
}

form input:focus, form select:focus, form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 88, 255, 0.1);
}

form textarea {
  resize: vertical;
  min-height: 100px;
}

/* Activity & History Lists */
.activity-list, .history-list {
  list-style: none;
}

.activity-item {
  padding: 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-fast);
}

.activity-item:hover {
  background: var(--bg-secondary);
}

.activity-type {
  display: inline-block;
  padding: 4px 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent-teal));
  color: white;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  margin-right: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.activity-date {
  color: var(--text-tertiary);
  font-size: 13px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.stat-card {
  background: var(--surface);
  padding: 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: all var(--transition-base);
}

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

.stat-card h3 {
  font-size: 13px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  margin-bottom: 16px;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.big-number {
  font-size: 56px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.03em;
  line-height: 1;
}

.ae-stat {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ae-stat:last-child {
  border-bottom: none;
}

/* Settings Page */
.settings-container {
  max-width: 900px;
}

.settings-section {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.settings-section h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.settings-section p {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 24px;
}

.color-picker-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.color-picker-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.color-picker-item label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

.color-picker-item input[type="color"] {
  width: 100%;
  height: 48px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: 4px;
  background: var(--bg-primary);
}

.logo-upload-area {
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 48px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-primary);
}

.logo-upload-area:hover {
  border-color: var(--primary);
  background: rgba(0, 88, 255, 0.02);
}

.logo-upload-area.drag-over {
  border-color: var(--primary);
  background: rgba(0, 88, 255, 0.05);
}

.logo-upload-area p {
  margin: 0;
  color: var(--text-secondary);
}

.logo-preview {
  margin-top: 24px;
  padding: 24px;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 120px;
}

.logo-preview svg {
  max-width: 100%;
  max-height: 80px;
}

/* Logo Gradient Section */
.logo-gradient-section {
  margin-top: 24px;
  padding: 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.logo-gradient-section h4 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.logo-gradient-section p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
}

.gradient-selector {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.gradient-selector label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  cursor: pointer;
  padding: 12px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  transition: all var(--transition-fast);
}

.gradient-selector label:hover {
  border-color: var(--primary);
}

.gradient-selector input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.gradient-class-input {
  margin-bottom: 20px;
}

.gradient-class-input input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-size: 14px;
  background: var(--surface);
}

.gradient-class-input input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 88, 255, 0.1);
}

.gradient-class-input .hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 8px;
  margin-bottom: 0;
}

.gradient-preview {
  padding: 16px;
  background: #000;
  border-radius: var(--radius-md);
}

.gradient-preview p {
  color: #fff;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.gradient-bar {
  height: 4px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-yellow), var(--accent-teal), var(--accent-blue), var(--accent-cyan));
  background-size: 300% 100%;
  animation: gradientFlow 6s ease infinite;
  border-radius: 2px;
}

.settings-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* Utilities */
.hidden {
  display: none !important;
}

.empty {
  color: var(--text-secondary);
  padding: 48px;
  text-align: center;
  font-size: 16px;
}

.success { color: var(--success); }
.danger { color: var(--danger); }

pre.clay-data {
  background: var(--text-primary);
  color: #03ffe9;
  padding: 20px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: 13px;
  font-family: 'SF Mono', Monaco, monospace;
}

.activity-input {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.activity-input input {
  flex: 1;
  padding: 14px 18px;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  font-size: 15px;
  outline: none;
}

.activity-input input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 88, 255, 0.1);
}

.file-list {
  list-style: none;
  margin-top: 16px;
}

.file-list li {
  padding: 12px;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ae-info {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
  .header-content {
    padding: 12px 16px;
  }
  
  nav {
    padding: 8px 16px;
  }
  
  main {
    padding: 20px;
  }
  
  .list-container {
    grid-template-columns: 1fr;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .filters {
    width: 100%;
  }
}
