/**
 * Dashboard Styles
 * Investor dashboard for team management and deals
 */

/* Navigation */
.nav-links {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.nav-links a {
  color: #666;
  text-decoration: none;
  font-size: 14px;
  padding-bottom: 4px;
}

.nav-links a:hover {
  color: #333;
}

.nav-links a.active {
  color: #0066cc;
  border-bottom: 2px solid #0066cc;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 600px;
  margin: 0 auto;
}

header {
  margin-bottom: 24px;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.header-content {
  flex: 1;
}

header h1 {
  font-size: 24px;
  font-weight: 600;
  color: #111;
  margin-bottom: 4px;
}

header .subtitle {
  color: #666;
  font-size: 14px;
}

/* Cards */
.card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #333;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group {
  flex: 1;
}

label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #444;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"] {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  transition: border-color 0.2s;
}

input:focus {
  outline: none;
  border-color: #0066cc;
}

input::placeholder {
  color: #999;
}

/* Buttons */
button,
.btn-primary {
  display: inline-block;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: white;
  background: #0066cc;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover,
.btn-primary:hover {
  background: #0055aa;
}

button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

button.loading {
  position: relative;
  color: transparent;
}

button.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid white;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.btn-remove {
  padding: 6px 12px;
  font-size: 12px;
  background: #dc3545;
}

.btn-remove:hover {
  background: #c82333;
}

.btn-logout {
  padding: 8px 16px;
  font-size: 13px;
  background: transparent;
  color: #666;
  border: 1px solid #ddd;
}

.btn-logout:hover {
  background: #f5f5f5;
  color: #333;
  border-color: #ccc;
}

/* Form Actions */
.form-actions {
  margin-top: 20px;
}

/* Error Messages */
.form-error,
.error-message {
  color: #dc3545;
  font-size: 14px;
  margin-top: 8px;
}

.hidden {
  display: none !important;
}

/* Team List */
.team-member {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.team-member:last-child {
  border-bottom: none;
}

.member-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.member-name {
  font-weight: 500;
  color: #333;
}

.member-phone {
  font-size: 13px;
  color: #666;
}

.member-role {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  display: inline-block;
  width: fit-content;
  margin-top: 4px;
}

.member-role.deal_finder {
  background: #e3f2fd;
  color: #1565c0;
}

.member-role.investor {
  background: #f3e5f5;
  color: #7b1fa2;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 32px 16px;
  color: #666;
  font-size: 14px;
}

/* Loading State */
.loading-state {
  text-align: center;
  padding: 48px 16px;
  color: #666;
}

/* Auth Error */
.auth-error {
  text-align: center;
  padding: 48px 16px;
}

.auth-error p {
  color: #666;
}

.auth-error a {
  color: #0066cc;
  text-decoration: none;
}

.auth-error a:hover {
  text-decoration: underline;
}

/* Form Footer */
.form-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: #666;
}

.form-footer a {
  color: #0066cc;
  text-decoration: none;
}

.form-footer a:hover {
  text-decoration: underline;
}

/* Usage Badge */
.usage-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  background: #f0f0f0;
  border-radius: 12px;
  color: #666;
}

.usage-badge .plan-name {
  text-transform: capitalize;
}

.usage-badge.plan-free {
  background: #f5f5f5;
  color: #666;
}

.usage-badge.plan-starter {
  background: #e3f2fd;
  color: #1565c0;
}

.usage-badge.plan-pro {
  background: #f3e5f5;
  color: #7b1fa2;
}

/* Upgrade Button */
.btn-upgrade {
  padding: 8px 16px;
  font-size: 13px;
  background: #10b981;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
}

.btn-upgrade:hover {
  background: #059669;
}

/* Settings Page - Plan Card */
.plan-current {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: #f9f9f9;
  border-radius: 8px;
  margin-bottom: 16px;
}

.plan-info h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
  text-transform: capitalize;
}

.plan-info .plan-price {
  font-size: 14px;
  color: #666;
}

.plan-usage {
  text-align: right;
}

.plan-usage .usage-text {
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
}

/* Progress Bar */
.progress-bar {
  width: 120px;
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar .progress-fill {
  height: 100%;
  background: #0066cc;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-bar .progress-fill.warning {
  background: #f59e0b;
}

.progress-bar .progress-fill.danger {
  background: #ef4444;
}

/* Upgrade Plans Grid */
.plans-grid {
  display: flex;
  gap: 16px;
  margin-top: 16px;
}

.plan-option {
  flex: 1;
  padding: 20px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  text-align: center;
  transition: border-color 0.2s;
}

.plan-option:hover {
  border-color: #0066cc;
}

.plan-option.current {
  border-color: #10b981;
  background: #f0fdf4;
}

.plans-note {
  color: #6b7280;
  font-size: 14px;
  margin-bottom: 16px;
}

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

.plans-table th,
.plans-table td {
  padding: 12px 8px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.plans-table th {
  font-weight: 500;
  color: #6b7280;
  font-size: 13px;
}

.plans-table tbody tr:hover {
  background: #f9fafb;
}

.plans-table tr.current {
  background: #f0fdf4;
}

.btn-small {
  padding: 6px 12px;
  font-size: 13px;
  background: #0066cc;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.btn-small:hover {
  background: #0052a3;
}

.btn-small:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.plan-option h4 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.plan-option .price {
  font-size: 24px;
  font-weight: 700;
  color: #333;
  margin-bottom: 4px;
}

.plan-option .price span {
  font-size: 14px;
  font-weight: 400;
  color: #666;
}

.plan-option .features {
  font-size: 13px;
  color: #666;
  margin-bottom: 16px;
}

.plan-option .btn-plan {
  width: 100%;
  padding: 10px;
}

.plan-option .btn-current {
  background: #10b981;
  cursor: default;
}

.plan-option .btn-current:hover {
  background: #10b981;
}

/* Billing Period */
.billing-period {
  font-size: 13px;
  color: #888;
  margin-top: 12px;
}

/* Features List */
.features-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
  font-size: 13px;
  color: #666;
  text-align: left;
}

.features-list li {
  padding: 4px 0;
  padding-left: 20px;
  position: relative;
}

.features-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #10b981;
  font-weight: 600;
}

/* Limits List */
.limits-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.limit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

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

.limit-label {
  color: #666;
  font-size: 14px;
}

.limit-value {
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

/* Settings Tabs */
.settings-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
}

.settings-tab {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.settings-tab:hover {
  color: #333;
  background: transparent;
}

.settings-tab.active {
  color: #0066cc;
  border-bottom-color: #0066cc;
  background: transparent;
}

/* Tab Content */
.tab-content {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Criteria Form */
.card-description {
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
  line-height: 1.5;
}

.criteria-form {
  margin-top: 8px;
}

.criteria-section {
  margin-bottom: 24px;
}

.criteria-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: #444;
  margin-bottom: 12px;
}

.section-hint {
  font-size: 13px;
  color: #888;
  margin-bottom: 12px;
}

.criteria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.criteria-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.criteria-field label {
  font-size: 13px;
  font-weight: 500;
  color: #555;
  margin-bottom: 0;
}

.input-with-suffix {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
  background: white;
}

.input-with-suffix input {
  flex: 1;
  padding: 8px 12px;
  font-size: 14px;
  border: none;
  outline: none;
  width: 100%;
  min-width: 0;
}

.input-with-suffix:focus-within {
  border-color: #0066cc;
}

.input-suffix {
  padding: 8px 12px;
  font-size: 14px;
  color: #666;
  background: #f5f5f5;
  border-left: 1px solid #ddd;
  white-space: nowrap;
}

.field-hint {
  font-size: 11px;
  color: #888;
}

.threshold-note {
  font-size: 12px;
  color: #888;
  margin-top: 12px;
  font-style: italic;
}

/* Criteria Actions */
.criteria-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.btn-secondary {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #f5f5f5;
  border-color: #ccc;
  color: #333;
}

/* Save Status */
.save-status {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
}

.save-status.success {
  background: #d1fae5;
  color: #047857;
}

.save-status.error {
  background: #fee2e2;
  color: #dc2626;
}

/* Disabled Card */
.card-disabled {
  opacity: 0.6;
  pointer-events: none;
}

.coming-soon {
  color: #888;
  font-size: 14px;
  font-style: italic;
}

/* Responsive */
@media (max-width: 480px) {
  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .team-member {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .plans-grid {
    flex-direction: column;
  }

  .plan-current {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .plan-usage {
    text-align: center;
  }

  .progress-bar {
    margin: 0 auto;
  }

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

  .criteria-actions {
    flex-direction: column;
  }
}
