/* Rocket Prep Tutor View — Shared Mockup Theme */
/* Aligned with Minia Bootstrap theme used in tutor-management app */

:root {
  --rp-primary: #556ee6;
  --rp-primary-dark: #4857d4;
  --rp-secondary: #74788d;
  --rp-success: #34c38f;
  --rp-info: #50a5f1;
  --rp-warning: #f1b44c;
  --rp-danger: #f46a6a;
  --rp-dark: #2a3042;
  --rp-sidebar: #2a3042;
  --rp-body-bg: #f8f8fb;
  --rp-card-shadow: 0 0.75rem 1.5rem rgba(18, 38, 63, 0.03);
  --rp-border: #eff2f7;
  --rp-text: #495057;
  --rp-text-muted: #74788d;
  --rp-radius: 0.25rem;
  --rp-font: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--rp-font);
  background: var(--rp-body-bg);
  color: var(--rp-text);
  font-size: 14px;
  line-height: 1.5;
}

/* Layout */
.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
  width: 250px;
  background: var(--rp-sidebar);
  color: #a6b0cf;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-brand {
  padding: 20px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand h2 {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.sidebar-brand span {
  font-size: 11px;
  color: #79829c;
  display: block;
  margin-top: 4px;
}

.sidebar-menu { padding: 12px 0; }

.menu-title {
  padding: 12px 20px 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6a7187;
  font-weight: 500;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: #a6b0cf;
  text-decoration: none;
  font-size: 13.5px;
  transition: all 0.2s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
  color: #fff;
  background: rgba(255,255,255,0.05);
}

.sidebar-menu a.active { border-left: 3px solid var(--rp-primary); }

.sidebar-menu .badge-count {
  margin-left: auto;
  background: var(--rp-danger);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
}

.main-content {
  margin-left: 250px;
  flex: 1;
  padding: 24px;
}

/* Page header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 18px;
  font-weight: 600;
  color: #343a40;
}

.breadcrumb {
  font-size: 12px;
  color: var(--rp-text-muted);
}

.breadcrumb a { color: var(--rp-primary); text-decoration: none; }

/* Cards */
.card {
  background: #fff;
  border-radius: var(--rp-radius);
  box-shadow: var(--rp-card-shadow);
  border: 1px solid var(--rp-border);
  margin-bottom: 24px;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--rp-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: #343a40;
}

.card-body { padding: 20px; }

/* Grid */
.row { display: flex; flex-wrap: wrap; margin: 0 -12px; }
.col-3 { width: 25%; padding: 0 12px; }
.col-4 { width: 33.333%; padding: 0 12px; }
.col-6 { width: 50%; padding: 0 12px; }
.col-8 { width: 66.666%; padding: 0 12px; }
.col-12 { width: 100%; padding: 0 12px; }

/* Stat widgets */
.stat-card {
  background: #fff;
  border-radius: var(--rp-radius);
  box-shadow: var(--rp-card-shadow);
  border: 1px solid var(--rp-border);
  padding: 20px;
  margin-bottom: 24px;
}

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: #343a40;
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--rp-text-muted);
  margin-top: 4px;
}

.bg-primary-soft { background: rgba(85, 110, 230, 0.18); color: var(--rp-primary); }
.bg-success-soft { background: rgba(52, 195, 143, 0.18); color: var(--rp-success); }
.bg-warning-soft { background: rgba(241, 180, 76, 0.18); color: var(--rp-warning); }
.bg-danger-soft { background: rgba(244, 106, 106, 0.18); color: var(--rp-danger); }
.bg-info-soft { background: rgba(80, 165, 241, 0.18); color: var(--rp-info); }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--rp-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 2px solid var(--rp-border);
  background: #fafbfc;
}
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--rp-border);
  font-size: 13.5px;
}
.table tr:hover td { background: #fafbfc; }

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-primary { background: rgba(85,110,230,0.15); color: var(--rp-primary); }
.badge-success { background: rgba(52,195,143,0.15); color: var(--rp-success); }
.badge-warning { background: rgba(241,180,76,0.15); color: #c9922e; }
.badge-danger { background: rgba(244,106,106,0.15); color: var(--rp-danger); }
.badge-info { background: rgba(80,165,241,0.15); color: var(--rp-info); }
.badge-secondary { background: rgba(116,120,141,0.15); color: var(--rp-secondary); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--rp-radius);
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}
.btn-primary { background: var(--rp-primary); color: #fff; }
.btn-primary:hover { background: var(--rp-primary-dark); }
.btn-outline { background: transparent; border: 1px solid var(--rp-border); color: var(--rp-text); }
.btn-outline:hover { background: #f8f9fa; }
.btn-success { background: var(--rp-success); color: #fff; }
.btn-danger { background: var(--rp-danger); color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12px; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #343a40;
}
.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: var(--rp-radius);
  font-size: 13.5px;
  font-family: inherit;
}
.form-control:focus { outline: none; border-color: var(--rp-primary); box-shadow: 0 0 0 2px rgba(85,110,230,0.15); }
select.form-control { appearance: auto; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-check { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.required::after { content: ' *'; color: var(--rp-danger); }

/* Workflow diagram */
.workflow-section {
  background: #fff;
  border-radius: var(--rp-radius);
  box-shadow: var(--rp-card-shadow);
  border: 1px solid var(--rp-border);
  padding: 24px;
  margin-bottom: 24px;
}

.workflow-section h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 20px;
  color: #343a40;
}

.workflow {
  display: flex;
  align-items: flex-start;
  gap: 0;
  overflow-x: auto;
  padding: 8px 0;
}

.workflow-step {
  flex: 1;
  min-width: 140px;
  text-align: center;
  position: relative;
}

.workflow-step .step-box {
  background: #fff;
  border: 2px solid var(--rp-primary);
  border-radius: 8px;
  padding: 16px 12px;
  margin: 0 8px;
  position: relative;
}

.workflow-step .step-box.decision {
  border-color: var(--rp-warning);
  background: rgba(241,180,76,0.05);
}

.workflow-step .step-box.action {
  border-color: var(--rp-success);
  background: rgba(52,195,143,0.05);
}

.workflow-step .step-box.system {
  border-color: var(--rp-info);
  background: rgba(80,165,241,0.05);
}

.workflow-step .step-number {
  width: 28px;
  height: 28px;
  background: var(--rp-primary);
  color: #fff;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}

.workflow-step .step-title {
  font-size: 13px;
  font-weight: 600;
  color: #343a40;
  margin-bottom: 4px;
}

.workflow-step .step-desc {
  font-size: 11.5px;
  color: var(--rp-text-muted);
  line-height: 1.4;
}

.workflow-arrow {
  display: flex;
  align-items: center;
  padding-top: 40px;
  color: var(--rp-primary);
  font-size: 20px;
  flex-shrink: 0;
}

/* Modal mockup */
.modal-mockup {
  border: 2px dashed var(--rp-primary);
  border-radius: 8px;
  background: #fff;
  max-width: 560px;
  margin: 0 auto;
}

.modal-mockup .modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--rp-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-mockup .modal-header h4 { font-size: 15px; font-weight: 600; }
.modal-mockup .modal-body { padding: 20px; }
.modal-mockup .modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--rp-border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Message thread */
.thread-list { border-right: 1px solid var(--rp-border); }
.thread-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--rp-border);
  cursor: pointer;
  transition: background 0.15s;
}
.thread-item:hover, .thread-item.active { background: rgba(85,110,230,0.06); }
.thread-item.unread { border-left: 3px solid var(--rp-primary); }
.thread-item .thread-subject { font-weight: 600; font-size: 13.5px; }
.thread-item .thread-meta { font-size: 11.5px; color: var(--rp-text-muted); margin-top: 4px; }

.message-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 12px;
  font-size: 13.5px;
}
.message-bubble.sent { background: var(--rp-primary); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.message-bubble.received { background: #f0f2f5; color: var(--rp-text); border-bottom-left-radius: 4px; }
.message-time { font-size: 11px; color: var(--rp-text-muted); margin-bottom: 16px; }

/* Filters */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-pill {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--rp-border);
  background: #fff;
  cursor: pointer;
  color: var(--rp-text);
}
.filter-pill.active { background: var(--rp-primary); color: #fff; border-color: var(--rp-primary); }

/* Chart placeholder */
.chart-placeholder {
  height: 200px;
  background: linear-gradient(180deg, rgba(85,110,230,0.05) 0%, transparent 100%);
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius);
  position: relative;
  overflow: hidden;
}
.chart-line {
  position: absolute;
  bottom: 30px;
  left: 40px;
  right: 20px;
  height: 120px;
}
.chart-line svg { width: 100%; height: 100%; }

/* Index page */
.mockup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.mockup-card {
  background: #fff;
  border-radius: var(--rp-radius);
  box-shadow: var(--rp-card-shadow);
  border: 1px solid var(--rp-border);
  padding: 24px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}
.mockup-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(18,38,63,0.08);
}
.mockup-card h3 { font-size: 15px; font-weight: 600; color: var(--rp-primary); margin-bottom: 8px; }
.mockup-card p { font-size: 13px; color: var(--rp-text-muted); margin-bottom: 12px; }
.mockup-card .tag { font-size: 11px; color: var(--rp-text-muted); }

/* Annotation */
.annotation {
  background: rgba(85,110,230,0.08);
  border-left: 3px solid var(--rp-primary);
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 13px;
  border-radius: 0 var(--rp-radius) var(--rp-radius) 0;
}
.annotation strong { color: var(--rp-primary); }

/* Pay summary */
.pay-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--rp-border);
  font-size: 13.5px;
}
.pay-summary-row.total {
  font-weight: 700;
  font-size: 16px;
  border-bottom: none;
  padding-top: 16px;
  color: var(--rp-primary);
}

/* Nav back link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--rp-primary);
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 16px;
}
.back-link:hover { text-decoration: underline; }

/* Interactive Modal Overlay */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(42, 48, 66, 0.55);
  z-index: 1050;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.modal-overlay.show {
  display: flex;
  opacity: 1;
}
.modal-dialog {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(18, 38, 63, 0.2);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}
.modal-overlay.show .modal-dialog { transform: scale(1); }
.modal-dialog.lg { max-width: 720px; }
.modal-dialog.xl { max-width: 900px; }
.modal-dialog .modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--rp-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-dialog .modal-header h4 { font-size: 15px; font-weight: 600; margin: 0; }
.modal-dialog .modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--rp-text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.modal-dialog .modal-close:hover { color: var(--rp-danger); }
.modal-dialog .modal-body { padding: 20px; }
.modal-dialog .modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--rp-border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

/* Tabs */
.tab-nav {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--rp-border);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.tab-btn {
  padding: 10px 18px;
  border: none;
  background: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--rp-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-family: inherit;
  transition: color 0.15s;
}
.tab-btn:hover { color: var(--rp-primary); }
.tab-btn.active {
  color: var(--rp-primary);
  border-bottom-color: var(--rp-primary);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Matrix table */
.matrix-table { font-size: 12.5px; }
.matrix-table th, .matrix-table td {
  padding: 10px 12px;
  border: 1px solid var(--rp-border);
  vertical-align: top;
}
.matrix-table thead th {
  background: var(--rp-sidebar);
  color: #fff;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.03em;
}
.matrix-table tbody tr:nth-child(even) { background: #fafbfc; }
.matrix-table .highlight-row { background: rgba(85,110,230,0.08) !important; }

/* Radio cards */
.radio-card-group { display: flex; flex-direction: column; gap: 10px; }
.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid var(--rp-border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.radio-card:hover { border-color: rgba(85,110,230,0.4); }
.radio-card.selected {
  border-color: var(--rp-primary);
  background: rgba(85,110,230,0.06);
}
.radio-card input { margin-top: 3px; accent-color: var(--rp-primary); }
.radio-card .radio-title { font-weight: 600; font-size: 13.5px; }
.radio-card .radio-desc { font-size: 12px; color: var(--rp-text-muted); margin-top: 2px; }

/* Toggle switch */
.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--rp-border);
}
.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #ced4da;
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--rp-primary); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Toast */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 20px;
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  animation: slideIn 0.3s ease;
  max-width: 360px;
}
.toast.success { background: var(--rp-success); }
.toast.info { background: var(--rp-info); }
.toast.warning { background: var(--rp-warning); color: #343a40; }
.toast.danger { background: var(--rp-danger); }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Config grid */
.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.config-item {
  padding: 14px;
  border: 1px solid var(--rp-border);
  border-radius: 8px;
  background: #fafbfc;
}
.config-item label { font-size: 12px; color: var(--rp-text-muted); display: block; margin-bottom: 6px; }

/* Split panel */
.split-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.split-badge.tutor { background: rgba(52,195,143,0.15); color: var(--rp-success); }
.split-badge.client { background: rgba(244,106,106,0.15); color: var(--rp-danger); }
.split-badge.both { background: rgba(85,110,230,0.15); color: var(--rp-primary); }

/* Hidden billing note */
.billing-hidden {
  padding: 10px 14px;
  background: rgba(244,106,106,0.08);
  border: 1px dashed var(--rp-danger);
  border-radius: 6px;
  font-size: 12px;
  color: var(--rp-danger);
  margin-top: 8px;
}
.billing-visible {
  padding: 10px 14px;
  background: rgba(52,195,143,0.08);
  border: 1px dashed var(--rp-success);
  border-radius: 6px;
  font-size: 12px;
  color: #1a7a52;
  margin-top: 8px;
}

/* Responsive */
@media (max-width: 992px) {
  .col-3, .col-4, .col-6, .col-8 { width: 100%; }
  .sidebar { display: none; }
  .main-content { margin-left: 0; }
  .modal-dialog { max-width: 100%; }
}
