/* Dashboard styles — extends theme.css design tokens */

/* Auth gate */
.auth-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 62px);
  padding: 48px 24px;
}
.auth-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
.auth-title {
  font-family: var(--serif);
  font-size: 28px;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}
.auth-sub {
  color: var(--fg-muted);
  font-size: 15px;
  margin-bottom: 24px;
}

/* Inputs */
.input {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 15px;
  background: var(--bg);
  color: var(--fg);
  margin-bottom: 12px;
  outline: none;
  transition: border-color 0.15s;
}
.input:focus {
  border-color: var(--accent);
}
.textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-sm { padding: 6px 14px; font-size: 13px; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: none;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-ghost:hover { background: var(--bg-dark); border-color: var(--fg-light); }
.btn-xs { padding: 4px 10px; font-size: 12px; }
.btn-muted { color: var(--fg-light); }

.btn-danger {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background: #dc2626;
  color: white;
  border: none;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.btn-danger:hover { background: #b91c1c; }

/* Nav additions */
.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-user {
  font-size: 14px;
  color: var(--fg-muted);
  font-weight: 500;
}

/* Dashboard layout */
.dashboard { padding: 40px 48px; }
.dash-container {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}

.section-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.card-heading {
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: -0.3px;
  margin-bottom: 4px;
}
.card-sub {
  color: var(--fg-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

/* Template quick-insert bar */
.template-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--bg-dark);
  border-radius: 10px;
  flex-wrap: wrap;
}
.template-bar-label {
  font-size: 13px;
  color: var(--fg-light);
  font-weight: 500;
  white-space: nowrap;
}
.template-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.template-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--fg);
  transition: all 0.15s;
  font-family: var(--sans);
}
.template-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.chip-flash {
  background: var(--accent) !important;
  color: white !important;
  border-color: var(--accent) !important;
}
.type-chip-video { border-left: 3px solid #8b5cf6; }
.type-chip-audio { border-left: 3px solid #06b6d4; }
.type-chip-text { border-left: 3px solid var(--accent); }
.template-empty {
  font-size: 13px;
  color: var(--fg-light);
  font-style: italic;
}

/* Composer */
.composer { margin-top: 0; }
.composer-type-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.type-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  background: none;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--fg-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}
.type-tab:hover { color: var(--fg); }
.type-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.composer-textarea {
  width: 100%;
  min-height: 180px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--fg);
  background: var(--bg);
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}
.composer-textarea:focus { border-color: var(--accent); }

.composer-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}
.char-count {
  font-size: 13px;
  color: var(--fg-light);
}

/* Sidebar */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.template-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.template-item {
  padding: 14px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--border);
  transition: border-color 0.15s;
}
.template-item:hover { border-color: var(--fg-light); }

.template-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.type-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.type-text { background: #fef2e8; color: var(--accent); }
.type-video { background: #f3e8ff; color: #7c3aed; }
.type-audio { background: #e0f7fa; color: #0891b2; }

.template-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--fg);
}
.template-preview {
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.4;
  margin-bottom: 10px;
}
.template-actions {
  display: flex;
  gap: 6px;
}

.template-empty-state {
  text-align: center;
  padding: 32px 16px;
  color: var(--fg-muted);
}
.template-empty-state p:first-child {
  font-weight: 500;
  margin-bottom: 4px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,26,26,0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.modal-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 32px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 8px 40px rgba(0,0,0,0.12);
}
.modal-card-sm { max-width: 360px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.modal-title {
  font-family: var(--serif);
  font-size: 22px;
}
.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--fg-muted);
  cursor: pointer;
  padding: 4px;
}
.modal-close:hover { color: var(--fg); }

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 6px;
  margin-top: 16px;
}
.form-label:first-of-type { margin-top: 0; }
.form-hint {
  font-weight: 400;
  color: var(--fg-light);
}

.type-select {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
}
.type-option {
  cursor: pointer;
}
.type-option input[type="radio"] {
  display: none;
}
.type-option input[type="radio"]:checked + .type-badge {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* Responsive */
@media (max-width: 900px) {
  .dashboard { padding: 24px; }
  .dash-container {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 480px) {
  .auth-card { padding: 24px; }
  .modal-card { padding: 24px; }
}
