/* ==========================================================================
   dashboard.css -- Customer Dashboard-Specific Styles
   Styles unique to the customer dashboard not covered by components.css.
   ========================================================================== */

/* --- Assistant Cards --- */
.assistant-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: border-color 0.15s;
}

.assistant-card:hover {
  border-color: rgba(108, 92, 231, 0.3);
}

.assistant-info h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.assistant-info .domain {
  font-size: 13px;
  color: var(--accent);
}

.assistant-info .status {
  font-size: 12px;
  margin-top: 4px;
}

/* --- Onboarding Wizard --- */
.wizard-steps {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
}

.wizard-step {
  flex: 1;
  padding: 12px;
  text-align: center;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  transition: all 0.2s;
}

.wizard-step.active {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(108, 92, 231, 0.1);
}

.wizard-step.done {
  border-color: var(--success);
  color: var(--success);
  background: rgba(0, 184, 148, 0.1);
}

/* --- Color Preview --- */
.color-preview {
  width: 100%;
  height: 60px;
  border-radius: 8px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: white;
  transition: background 0.3s;
}

/* --- Auth Pages --- */
.auth-page {
  min-height: 100vh;
  background: var(--bg);
}

.auth-container {
  max-width: 420px;
  margin: 80px auto;
  padding: 0 24px;
}

.auth-container h1 {
  text-align: center;
}

.auth-container .subtitle {
  text-align: center;
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-dim);
}

.auth-switch a {
  color: var(--primary-light);
  cursor: pointer;
  text-decoration: none;
}

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

/* --- User Management --- */
.user-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

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

.user-name {
  font-weight: 600;
  color: var(--text);
}

.user-email {
  color: var(--text-dim);
  font-size: 13px;
}

.user-status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.user-status.active {
  background: rgba(0, 184, 148, 0.1);
  color: var(--success);
}

.user-status.invited {
  background: rgba(253, 203, 110, 0.1);
  color: var(--warning);
}

.user-date {
  font-size: 12px;
  color: var(--text-dim);
}

/* --- Data Source Management --- */
.ds-section {
  margin-bottom: 32px;
}

.ds-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.ds-section-title .ds-section-icon {
  font-size: 20px;
}

.ds-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.ds-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  position: relative;
  transition: border-color 0.2s;
}

.ds-card:hover {
  border-color: rgba(136, 136, 160, 0.3);
}

.ds-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.ds-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.ds-card-icon.db {
  background: rgba(108, 92, 231, 0.15);
}

.ds-card-icon.file {
  background: rgba(0, 206, 201, 0.15);
}

.ds-card-icon.drive {
  background: rgba(66, 133, 244, 0.15);
}

.ds-card-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ds-card-type {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ds-card-status {
  margin-bottom: 8px;
}

.ds-card-meta {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.ds-card-actions {
  display: flex;
  justify-content: flex-end;
}

.ds-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  border: 1px dashed var(--border);
  border-radius: 8px;
}

/* --- Type Picker --- */
.type-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.type-picker-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}

.type-picker-card:hover {
  border-color: var(--primary);
  background: rgba(108, 92, 231, 0.05);
}

.type-picker-card .tp-icon {
  font-size: 28px;
  margin-bottom: 8px;
}

.type-picker-card .tp-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

.type-picker-card .tp-desc {
  font-size: 11px;
  color: var(--text-dim);
}

/* --- Table List (database tables) --- */
.table-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-input);
  margin-top: 12px;
}

.table-list::-webkit-scrollbar {
  width: 6px;
}

.table-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.table-item {
  padding: 8px 12px;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(42, 42, 58, 0.5);
}

.table-item:nth-child(even) {
  background: rgba(26, 26, 36, 0.5);
}

.table-item:last-child {
  border-bottom: none;
}

.table-item .col-count {
  font-size: 11px;
  color: var(--text-dim);
  font-family: 'Inter', sans-serif;
}

/* --- Upload Progress --- */
.upload-progress {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 8px;
  background: rgba(108, 92, 231, 0.1);
  border: 1px solid rgba(108, 92, 231, 0.2);
  color: var(--primary-light);
  font-size: 13px;
  font-weight: 500;
}

.upload-progress .progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.upload-progress .progress-fill {
  height: 100%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 2px;
  transition: width 0.3s;
}

/* --- Google Drive Options --- */
.drive-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.drive-option-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}

.drive-option-card:hover {
  border-color: #4285F4;
  background: rgba(66, 133, 244, 0.05);
}

.drive-option-card .do-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.drive-option-card .do-title {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
}

.drive-option-card .do-desc {
  font-size: 11px;
  color: var(--text-dim);
}

/* --- Responsive Overrides --- */
@media (max-width: 640px) {
  .assistant-card {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .type-picker {
    grid-template-columns: 1fr;
  }

  .drive-options {
    grid-template-columns: 1fr;
  }

  .ds-cards {
    grid-template-columns: 1fr;
  }

  .user-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
