/* ============================================================
   ClickUp Sync — Team Dashboard Styles
   Premium, modern look with glassmorphism and smooth transitions
   ============================================================ */

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

:root {
  --primary: #7c3aed;
  --primary-light: #a78bfa;
  --primary-dark: #5b21b6;
  --primary-bg: rgba(124, 58, 237, 0.08);
  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.1);
  --bg: #0f0f1a;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --bg-input: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(124, 58, 237, 0.5);
  --text: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.4);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ============================================================
   Layout
   ============================================================ */

.app-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ============================================================
   Header / Navbar
   ============================================================ */

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.navbar-brand .logo {
  font-size: 1.5rem;
}

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

.navbar-user img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
}

.navbar-user span {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--primary-light);
  color: var(--primary-light);
  background: var(--primary-bg);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}

.btn-danger:hover {
  background: var(--danger-bg);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-icon {
  padding: 0.375rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  border-color: var(--primary-light);
  color: var(--primary-light);
}

.btn-google {
  background: white;
  color: #333;
  font-weight: 600;
  padding: 0.75rem 2rem;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.btn-google:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-google img {
  width: 20px;
  height: 20px;
}

/* ============================================================
   Cards
   ============================================================ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  backdrop-filter: blur(12px);
  transition: background 0.2s;
}

.card+.card {
  margin-top: 1rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.card-subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ============================================================
   Plan Badge
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-free {
  background: var(--bg-input);
  color: var(--text-muted);
}

.badge-pro {
  background: var(--primary-bg);
  color: var(--primary-light);
}

.badge-team {
  background: var(--success-bg);
  color: var(--success);
}

/* ============================================================
   Stat Grid (Dashboard)
   ============================================================ */

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-light);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

/* ============================================================
   Members Table
   ============================================================ */

.members-table {
  width: 100%;
  border-collapse: collapse;
}

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

.members-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.members-table tr:last-child td {
  border-bottom: none;
}

.members-table tr:hover td {
  background: var(--bg-card-hover);
}

.member-email {
  color: var(--text);
  font-weight: 500;
}

.role-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-xs);
  font-size: 0.8125rem;
  font-family: inherit;
  cursor: pointer;
}

.role-select:focus {
  outline: none;
  border-color: var(--border-focus);
}

.role-select:disabled {
  opacity: 0.5;
  cursor: default;
}

.role-badge {
  display: inline-flex;
  padding: 0.125rem 0.5rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
}

.role-owner {
  background: var(--warning-bg);
  color: var(--warning);
}

.role-admin {
  background: var(--primary-bg);
  color: var(--primary-light);
}

.role-member {
  background: var(--bg-input);
  color: var(--text-muted);
}

/* ============================================================
   Add Member Form
   ============================================================ */

.add-member-form {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.add-member-form input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.625rem 1rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
}

.add-member-form input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.add-member-form input::placeholder {
  color: var(--text-muted);
}

.add-member-form select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
}

/* ============================================================
   Seat Meter
   ============================================================ */

.seat-meter {
  margin-top: 0.5rem;
}

.seat-bar {
  height: 6px;
  background: var(--bg-input);
  border-radius: 100px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.seat-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 100px;
  transition: width 0.4s ease;
}

.seat-text {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.seat-text strong {
  color: var(--text);
}

/* ============================================================
   Login Screen
   ============================================================ */

.login-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
}

.login-screen h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.login-screen p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 400px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3rem;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-lg);
}

/* ============================================================
   Tabs
   ============================================================ */

.tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.tab {
  padding: 0.75rem 1.25rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab:hover {
  color: var(--text-secondary);
}

.tab.active {
  color: var(--primary-light);
  border-bottom-color: var(--primary);
}

/* ============================================================
   Toast / Notifications
   ============================================================ */

.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  max-width: 400px;
}

.toast-success {
  background: #065f46;
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.toast-error {
  background: #7f1d1d;
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.toast-info {
  background: #1e3a5f;
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============================================================
   Loading States
   ============================================================ */

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary-light);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 1rem;
  color: var(--text-muted);
}

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

.hidden {
  display: none !important;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 600px) {
  .app-container {
    padding: 1rem;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .add-member-form {
    flex-direction: column;
  }

  .members-table th:last-child,
  .members-table td:last-child {
    text-align: right;
  }

  .pricing-grid {
    flex-direction: column;
    align-items: center;
  }

  .pricing-card {
    max-width: 100%;
  }
}

/* ============================================================
   Login Hint
   ============================================================ */

.login-hint {
  font-size: 0.8125rem;
  color: var(--warning);
  background: var(--warning-bg);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* ============================================================
   Pricing Page
   ============================================================ */

.pricing-header {
  text-align: center;
  margin-bottom: 2rem;
}

.pricing-header h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.pricing-header p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* Toggle */
.billing-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 0.375rem 1.25rem;
  margin: 1.5rem auto 2rem;
  cursor: pointer;
}

.billing-toggle-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.25s;
}

.billing-toggle-label.active {
  color: var(--primary-light);
}

.billing-toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
}

.billing-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.billing-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--primary);
  border-radius: 24px;
  transition: background 0.3s;
  cursor: pointer;
}

.billing-toggle-slider::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(.4, 0, .2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.billing-toggle-switch input:checked~.billing-toggle-slider::before {
  transform: translateX(20px);
}

.billing-save-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--success), #34d399);
  color: #fff;
  padding: 0.125rem 0.5rem;
  border-radius: 100px;
  letter-spacing: 0.03em;
}

/* Card Grid */
.pricing-grid {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.pricing-card {
  flex: 1;
  max-width: 310px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  backdrop-filter: blur(12px);
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.pricing-card.popular {
  border-color: var(--primary);
  background: linear-gradient(160deg, rgba(124, 58, 237, 0.15) 0%, rgba(124, 58, 237, 0.05) 100%);
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 16px 48px rgba(124, 58, 237, 0.25);
}

.pricing-card.popular:hover {
  transform: translateY(-14px) scale(1.02);
}

.pricing-ribbon {
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.375rem 1.25rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  white-space: nowrap;
}

.pricing-plan-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.pricing-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.pricing-price-row {
  display: flex;
  align-items: flex-end;
  gap: 0.125rem;
  margin-bottom: 0.25rem;
}

.pricing-currency {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--primary-light);
  line-height: 1.6;
}

.pricing-amount {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--primary-light);
  line-height: 1;
  transition: opacity 0.2s;
}

.pricing-per {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.8;
}

.pricing-annual-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-height: 1rem;
  margin-bottom: 1rem;
}

.pricing-annual-note strong {
  color: var(--success);
}

.pricing-divider {
  height: 1px;
  background: var(--border);
  margin: 0 0 1rem;
}

.pricing-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 1.5rem;
  flex: 1;
}

.pricing-feature {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.pricing-feature-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.pricing-btn {
  display: block;
  width: 100%;
  padding: 0.75rem 0;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  border: none;
  font-family: inherit;
  margin-top: auto;
}

.pricing-btn-primary {
  background: var(--primary);
  color: #fff;
}

.pricing-btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.pricing-btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.pricing-btn-outline:hover {
  border-color: var(--primary-light);
  color: var(--primary-light);
  background: var(--primary-bg);
}

.pricing-btn-current {
  background: var(--bg-input);
  color: var(--text-muted);
  cursor: default;
  opacity: 0.6;
}

.pricing-btn-danger {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
}

.pricing-btn-danger:hover {
  background: var(--danger-bg);
}

.pricing-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ============================================================
   Billing Page
   ============================================================ */

.billing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  backdrop-filter: blur(12px);
}

.billing-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.billing-row:last-child {
  border-bottom: none;
}

.billing-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.billing-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}

.billing-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  justify-content: center;
}

.email-mismatch-warning {
  background: var(--danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
  color: var(--danger);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.pricing-footer {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 0.5rem;
}

/* =========================================
   CUSTOM MODAL
========================================= */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-overlay.hidden {
  display: none !important;
}

.modal-content {
  background: #1e1e2e;
  border: 1px solid var(--border);
  padding: 28px;
  border-radius: var(--radius);
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.modal-content h3 {
  margin: 0 0 12px 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.modal-content p {
  margin: 0 0 24px 0;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.9375rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}