/* Home Captain Demo Styles - Warm, Jewel-Toned Colorway */

/* Color Palette */
:root {
  --gold: #F2B233;
  --gold-dark: #c99020;
  --raspberry: #7A0C22;
  --raspberry-dark: #5a0818;
  --olive: #8B9A4A;
  --olive-dark: #6b7a38;
  --deep-plum: #5C3A6E;
  --deep-plum-dark: #442b50;
  --burnt-orange: #C04A1A;
  --burnt-orange-dark: #903815;
  --teal: #1A6B7A;
  --teal-dark: #14505a;
  --chartreuse: #8B8C1A;
  --chartreuse-dark: #6a6a14;
  --cream: #EDEBE3;
  --cream-dark: #d4d1c4;
  --cream-light: #f5f3ec;

  --serif: 'DM Serif Display', Georgia, serif;
  --sans: 'DM Sans', system-ui, sans-serif;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: var(--sans);
  background: var(--cream);
  color: #1a1a1a;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes sync {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes typing {
  0%, 60%, 100% { opacity: 0.3; }
  30% { opacity: 1; }
}

.animate-in {
  animation: fadeInUp 0.5s ease forwards;
}

/* Demo Container */
.captain-demo {
  min-height: 100vh;
  padding-top: 80px;
}

/* Header */
.demo-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--cream);
  border-bottom: 1px solid var(--cream-dark);
  padding: 16px 40px;
}

.demo-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

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

.demo-logo-icon {
  width: 40px;
  height: 40px;
  background: var(--deep-plum);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold);
  font-size: 1.2rem;
}

.demo-logo-text {
  display: flex;
  flex-direction: column;
}

.demo-logo-title {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--deep-plum);
}

.demo-logo-sub {
  font-size: 0.7rem;
  color: #888;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Role Switcher */
.role-switcher {
  display: flex;
  gap: 8px;
}

.role-pill {
  padding: 10px 20px;
  border-radius: 100px;
  border: 2px solid transparent;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  color: #555;
}

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

.role-pill.active {
  color: white;
  box-shadow: var(--shadow-md);
}

.role-pill[data-role="coordinator"] {
  border-color: var(--deep-plum);
}

.role-pill[data-role="coordinator"].active {
  background: var(--deep-plum);
}

.role-pill[data-role="family"] {
  border-color: var(--gold);
}

.role-pill[data-role="family"].active {
  background: var(--gold);
}

.role-pill[data-role="support"] {
  border-color: var(--teal);
}

.role-pill[data-role="support"].active {
  background: var(--teal);
}

.role-pill[data-role="seeker"] {
  border-color: var(--olive);
}

.role-pill[data-role="seeker"].active {
  background: var(--olive);
}

/* Load Meter */
.load-meter {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.load-meter-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #666;
}

.load-meter-bar {
  width: 120px;
  height: 8px;
  background: var(--cream-dark);
  border-radius: 100px;
  overflow: hidden;
}

.load-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--olive), var(--gold), var(--raspberry));
  border-radius: 100px;
  transition: width 0.5s ease;
}

.load-meter-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--raspberry);
}

/* Main Content */
.demo-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  margin-bottom: 32px;
}

.dashboard-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dashboard-sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Dashboard Cards */
.dash-card {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all 0.3s ease;
}

.dash-card:hover {
  box-shadow: var(--shadow-md);
}

.dash-card-header {
  padding: 24px 28px;
  border-bottom: 1px solid var(--cream);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dash-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dash-card-title-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.dash-card-body {
  padding: 24px 28px;
}

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

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  background: var(--cream-light);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.task-item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

.task-urgency {
  width: 4px;
  height: 100%;
  min-height: 48px;
  border-radius: 2px;
  flex-shrink: 0;
}

.task-urgency.high { background: var(--raspberry); }
.task-urgency.medium { background: var(--gold); }
.task-urgency.low { background: var(--olive); }

.task-content {
  flex: 1;
}

.task-title {
  font-weight: 500;
  font-size: 0.95rem;
  color: #1a1a1a;
  margin-bottom: 4px;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: #888;
}

.task-assignee {
  display: flex;
  align-items: center;
  gap: 4px;
}

.task-time {
  display: flex;
  align-items: center;
  gap: 4px;
}

.task-notes {
  font-size: 0.8rem;
  color: #666;
  margin-top: 6px;
  font-style: italic;
}

/* Task Creation Form */
.task-form {
  display: grid;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #666;
}

.form-input, .form-select, .form-textarea {
  padding: 12px 16px;
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-family: var(--sans);
  background: white;
  transition: all 0.2s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--deep-plum);
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.btn {
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-family: var(--sans);
}

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

.btn-primary:hover {
  background: var(--deep-plum-dark);
  transform: translateY(-1px);
}

/* Life Vault */
.vault-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.vault-item {
  padding: 20px;
  background: var(--cream-light);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.vault-item:hover {
  box-shadow: var(--shadow-sm);
}

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

.vault-item-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.vault-item-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.vault-item-type {
  font-size: 0.75rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Permission Badges */
.permission-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.permission-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: white;
}

.permission-badge.coordinator { background: var(--deep-plum); }
.permission-badge.family { background: var(--gold); }
.permission-badge.support { background: var(--teal); }
.permission-badge.seeker { background: var(--olive); }

/* Consent Toggle */
.consent-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-top: 1px solid var(--cream-dark);
}

.consent-toggle-label {
  font-size: 0.8rem;
  color: #666;
}

.consent-toggle-switch {
  width: 44px;
  height: 24px;
  border-radius: 100px;
  background: var(--cream-dark);
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.consent-toggle-switch.active {
  background: var(--olive);
}

.consent-toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.consent-toggle-switch.active::after {
  left: 22px;
}

/* Calendar Timeline */
.calendar-container {
  overflow-x: auto;
  padding-bottom: 16px;
}

.calendar-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 800px;
}

.calendar-person {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calendar-person-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.calendar-person-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
}

.calendar-person-info {
  display: flex;
  flex-direction: column;
}

.calendar-person-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.calendar-person-role {
  font-size: 0.75rem;
  color: #888;
}

.calendar-events {
  display: flex;
  gap: 8px;
  padding-left: 48px;
  overflow-x: auto;
}

.calendar-event {
  flex-shrink: 0;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s ease;
}

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

.calendar-event-time {
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.85;
  margin-top: 2px;
}

/* Integration Cards */
.integration-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.integration-card {
  padding: 20px;
  background: var(--cream-light);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

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

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

.integration-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.integration-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.integration-status {
  font-size: 0.75rem;
  color: var(--olive);
  display: flex;
  align-items: center;
  gap: 4px;
}

.integration-sync {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #888;
}

.sync-icon {
  animation: sync 2s linear infinite;
}

.integration-data-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.data-flow-tag {
  padding: 4px 10px;
  background: white;
  border-radius: 100px;
  font-size: 0.7rem;
  color: #666;
  border: 1px solid var(--cream-dark);
}

/* AI Assistant */
.ai-panel {
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  max-height: 500px;
}

.ai-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--cream);
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-avatar {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--deep-plum), var(--teal));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
}

.ai-title {
  font-weight: 600;
  font-size: 1rem;
}

.ai-subtitle {
  font-size: 0.8rem;
  color: #888;
}

.ai-chat {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ai-message {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-message-content {
  padding: 16px 20px;
  background: var(--cream);
  border-radius: var(--radius-lg);
  border-top-left-radius: 4px;
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 90%;
  animation: fadeInUp 0.3s ease;
}

.ai-suggestion-actions {
  display: flex;
  gap: 8px;
  padding-left: 8px;
}

.ai-action-btn {
  padding: 8px 16px;
  background: var(--deep-plum);
  color: white;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.ai-action-btn:hover {
  background: var(--deep-plum-dark);
  transform: translateY(-1px);
}

.ai-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
}

.ai-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--deep-plum);
  animation: typing 1.4s ease infinite;
}

.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }

.ai-input-area {
  padding: 20px 24px;
  border-top: 1px solid var(--cream);
  display: flex;
  gap: 12px;
}

.ai-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--cream-dark);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-family: var(--sans);
}

.ai-input:focus {
  outline: none;
  border-color: var(--deep-plum);
}

.ai-send-btn {
  width: 48px;
  height: 48px;
  background: var(--deep-plum);
  color: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.ai-send-btn:hover {
  background: var(--deep-plum-dark);
}

/* Role-specific Dashboard Styles */
.role-dashboard {
  display: none;
}

.role-dashboard.active {
  display: block;
  animation: fadeInUp 0.4s ease;
}

.role-dashboard-header {
  padding: 24px 28px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  color: white;
}

.role-dashboard-header.coordinator { background: var(--deep-plum); }
.role-dashboard-header.family { background: var(--gold); color: #1a1a1a; }
.role-dashboard-header.support { background: var(--teal); }
.role-dashboard-header.seeker { background: var(--olive); }

.role-welcome {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-bottom: 4px;
}

.role-title {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.role-description {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Section Titles */
.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #888;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 0.9rem;
}

/* Delegation Flow */
.delegation-flow {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--cream-light);
  border-radius: var(--radius-md);
  margin-top: 16px;
}

.delegation-arrow {
  color: var(--deep-plum);
  font-size: 1.2rem;
}

.delegation-text {
  font-size: 0.85rem;
  color: #666;
}

/* Urgency Legend */
.urgency-legend {
  display: flex;
  gap: 16px;
  padding: 12px 16px;
  background: var(--cream-light);
  border-radius: var(--radius-md);
}

.urgency-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #666;
}

.urgency-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* Demo CTA Link */
.demo-cta-link {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 32px;
  background: var(--deep-plum);
  color: white;
  border-radius: var(--radius-lg);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-md);
}

.demo-cta-link:hover {
  background: var(--deep-plum-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.demo-cta-badge {
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.8;
  letter-spacing: 0.02em;
}

/* Footer */
.demo-footer {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px;
  text-align: center;
  border-top: 1px solid var(--cream-dark);
  margin-top: 48px;
}

.demo-footer-text {
  font-size: 0.85rem;
  color: #888;
}

/* Responsive */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .demo-header {
    padding: 12px 20px;
  }

  .demo-header-inner {
    flex-wrap: wrap;
    gap: 12px;
  }

  .role-switcher {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .role-pill {
    padding: 8px 14px;
    font-size: 0.8rem;
  }

  .load-meter {
    display: none;
  }

  .demo-main {
    padding: 20px;
  }

  .dashboard-sidebar {
    grid-template-columns: 1fr;
  }

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

  .form-row {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 480px) {
  .demo-logo-sub {
    display: none;
  }

  .role-pill span:not(:first-child) {
    display: none;
  }
}
