@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
  /* Warm Calming Palette (Aesthetic Warm and Empathetic) */
  --bg-primary: #fbf9f6;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f5efe6;
  
  --color-terracotta: #d37556;
  --color-terracotta-dark: #b85b3c;
  --color-terracotta-light: #fbece6;
  
  --color-sage: #5b8266;
  --color-sage-dark: #45624d;
  --color-sage-light: #ecf3ed;
  
  --color-peach: #f5ccb0;
  --color-peach-light: #fef4ec;
  
  --color-slate-dark: #2c3e50;
  --color-slate: #3e5871;
  --color-slate-light: #7e94a8;
  
  --color-gray-light: #f0f0f0;
  --color-success: #2ecc71;
  --color-warning: #f39c12;
  --color-danger: #e74c3c;

  /* Typography */
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;

  /* Shadow & Radii */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 15px -3px rgba(184, 91, 60, 0.08), 0 4px 6px -2px rgba(184, 91, 60, 0.03);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Accessibility settings for high contrast trigger */
.high-contrast {
  --bg-primary: #000000;
  --bg-secondary: #121212;
  --bg-tertiary: #1e1e1e;
  --color-slate-dark: #ffffff;
  --color-slate: #ffffff;
  --color-slate-light: #e0e0e0;
  --color-terracotta: #ff8a65;
  --color-terracotta-dark: #ffb74d;
  --color-terracotta-light: #331a00;
  --color-sage: #81c784;
  --color-sage-light: #1b5e20;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--color-slate-dark);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  color: var(--color-slate-dark);
  font-weight: 600;
}

/* Layout Shell */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-header {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--bg-tertiary);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  background-color: var(--color-terracotta-light);
  color: var(--color-terracotta);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
}

.logo-text {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-slate-dark);
}

.logo-tagline {
  font-size: 0.75rem;
  color: var(--color-sage);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav-links {
  display: flex;
  gap: 0.5rem;
}

.nav-btn {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-slate);
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.nav-btn:hover {
  background-color: var(--color-peach-light);
  color: var(--color-terracotta);
}

.nav-btn.active {
  background-color: var(--color-terracotta-light);
  color: var(--color-terracotta);
}

.main-content {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Page Containers */
.page-view {
  animation: fadeIn 0.3s ease-out;
}

/* Hero Section */
.hero {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, var(--color-peach-light) 0%, var(--bg-primary) 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--bg-tertiary);
}

.hero h2 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  color: var(--color-slate-dark);
}

.hero p {
  font-size: 1.1rem;
  color: var(--color-slate);
  max-width: 600px;
  margin: 0 auto;
}

/* Filter Controls */
.search-controls {
  background-color: var(--bg-secondary);
  border: 1px solid var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

.search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.filter-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-slate);
}

.filter-group input, .filter-group select {
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.8rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--bg-tertiary);
  outline: none;
  background-color: var(--bg-primary);
  color: var(--color-slate-dark);
  transition: border-color 0.2s ease;
}

.filter-group input:focus, .filter-group select:focus {
  border-color: var(--color-terracotta);
  background-color: var(--bg-secondary);
}

/* Professional Card Grid */
.prof-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.prof-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.prof-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.prof-card-header {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.prof-avatar {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-peach);
  background-color: var(--bg-tertiary);
}

.prof-headline h4 {
  font-size: 1.15rem;
  color: var(--color-slate-dark);
  margin-bottom: 0.2rem;
}

.prof-university {
  font-size: 0.8rem;
  color: var(--color-slate-light);
  font-style: italic;
}

.badge-social {
  background-color: var(--color-sage-light);
  color: var(--color-sage-dark);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border-radius: 20px;
  letter-spacing: 0.3px;
  animation: pulse-sage 2s infinite alternate;
  display: inline-block;
}

.prof-card-top-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
  min-height: 22px;
}

.prof-details {
  font-size: 0.85rem;
  color: var(--color-slate);
  margin-bottom: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.detail-row {
  display: flex;
  gap: 0.5rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.2rem;
}

.tag {
  background-color: var(--bg-tertiary);
  color: var(--color-slate);
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.btn-book {
  width: 100%;
  background-color: var(--color-terracotta);
  color: white;
  border: none;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-book:hover {
  background-color: var(--color-terracotta-dark);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(44, 62, 80, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background-color: var(--bg-secondary);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 90%;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.close-modal-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-slate-light);
}

/* Onboarding Forms & Steps */
.onboarding-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.step-indicator {
  flex: 1;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-slate-light);
  border-bottom: 2px solid var(--color-gray-light);
  padding-bottom: 0.5rem;
  transition: all 0.3s ease;
}

.step-indicator.active {
  color: var(--color-terracotta);
  border-color: var(--color-terracotta);
}

.onboard-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.span-2 {
  grid-column: span 2;
}

.btn-submit {
  background-color: var(--color-terracotta);
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-submit:hover {
  background-color: var(--color-terracotta-dark);
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--color-slate-dark);
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-sm);
  border: none;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin-right: 0.5rem;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background-color: var(--color-peach-light);
}

/* Transbank Mock Interface */
.webpay-portal {
  background-color: #2c3e50;
  color: white;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  font-family: 'Outfit', sans-serif;
}

.webpay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 0.8rem;
}

.webpay-logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: #ff6600;
  letter-spacing: 1px;
}

.webpay-amount {
  background-color: #27ae60;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-weight: 700;
}

.webpay-card {
  background-color: #34495e;
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

/* Admin Dashboard CSS */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.metric-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.metric-val {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-terracotta);
}

.metric-lbl {
  font-size: 0.8rem;
  color: var(--color-slate-light);
  font-weight: 600;
}

.admin-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

/* Lists and Tables */
.data-table-container {
  background-color: var(--bg-secondary);
  border: 1px solid var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th, .data-table td {
  padding: 0.8rem;
  border-bottom: 1px solid var(--bg-tertiary);
  font-size: 0.85rem;
}

.data-table th {
  font-weight: 700;
  color: var(--color-slate);
}

.badge-status {
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-status.approved { background-color: #e8f8f0; color: #27ae60; }
.badge-status.pending { background-color: #fef5e7; color: #f39c12; }
.badge-status.rejected { background-color: #fde8e8; color: #e74c3c; }

/* Dashboard Tabs Layout */
.dashboard-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
}

.dashboard-sidebar {
  background-color: var(--bg-secondary);
  border: 1px solid var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  box-shadow: var(--shadow-sm);
  height: fit-content;
}

.dashboard-menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.menu-item {
  background: none;
  border: none;
  font-family: var(--font-body);
  text-align: left;
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  color: var(--color-slate);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.menu-item:hover {
  background-color: var(--bg-primary);
  color: var(--color-terracotta);
}

.menu-item.active {
  background-color: var(--color-peach-light);
  color: var(--color-terracotta);
}

.menu-item.locked {
  color: var(--color-slate-light);
  opacity: 0.6;
  cursor: not-allowed;
}

.lock-badge {
  font-size: 0.7rem;
  background-color: var(--bg-tertiary);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

/* Audit Trails Log & SMTP Sandbox Console */
.sandbox-console {
  background-color: #1a222a;
  border-top: 3px solid var(--color-terracotta);
  color: #a3b8cc;
  font-family: monospace;
  font-size: 0.8rem;
  padding: 1rem;
  height: 250px;
  position: relative;
}

.sandbox-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid #2e3e4e;
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
}

.sandbox-tab-btn {
  background: none;
  border: none;
  color: #7d96af;
  font-family: monospace;
  font-weight: 600;
  padding: 0.3rem 0.8rem;
  cursor: pointer;
  border-radius: 2px;
}

.sandbox-tab-btn.active {
  background-color: #2e3e4e;
  color: white;
}

.sandbox-content {
  overflow-y: auto;
  height: 180px;
}

.log-line {
  margin-bottom: 0.3rem;
  border-bottom: 1px dashed rgba(255,255,255,0.05);
  padding-bottom: 0.2rem;
}

.log-time { color: var(--color-terracotta); }
.log-actor { color: #52a3ff; }
.log-action { color: #5bc97f; font-weight: bold; }
.log-msg { color: #e1e7ed; }

/* Interactive components style additions */
.progress-bar-container {
  background-color: var(--bg-tertiary);
  border-radius: 10px;
  height: 12px;
  width: 100%;
  margin-top: 0.5rem;
  overflow: hidden;
}

.progress-bar-fill {
  background-color: var(--color-terracotta);
  height: 100%;
  border-radius: 10px;
  transition: width 0.3s ease;
}

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

@keyframes scaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes pulse-sage {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(91, 130, 102, 0.4); }
  70% { transform: scale(1.02); box-shadow: 0 0 0 6px rgba(91, 130, 102, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(91, 130, 102, 0); }
}

/* Accessibility Toolbar in Navbar */
.accessibility-bar {
  display: flex;
  align-items: center;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--color-slate-light);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.accessibility-btn {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-slate-dark);
  padding: 0.4rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.accessibility-btn:hover, .accessibility-btn:focus {
  background-color: var(--bg-secondary);
  color: var(--color-terracotta);
}

.high-contrast .accessibility-bar {
  background-color: #121212;
  border-color: #ffffff;
}

.high-contrast .accessibility-btn {
  color: #ffffff;
}

.high-contrast .accessibility-btn:hover, .high-contrast .accessibility-btn:focus {
  background-color: #ffffff;
  color: #000000;
}

/* UI details */
.alert-card {
  padding: 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-card.warning {
  background-color: #fff8eb;
  border-left: 4px solid var(--color-warning);
  color: #a04000;
}
.alert-card.success {
  background-color: #f4fbf7;
  border-left: 4px solid var(--color-success);
  color: #196f3d;
}
.alert-card.error {
  background-color: #fef5f5;
  border-left: 4px solid var(--color-danger);
  color: #922b21;
}
.waitlist-card {
  background-color: var(--bg-tertiary);
  border: 1.5px dashed var(--color-slate-light);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
}

/* Responsiveness Media Queries */
@media (max-width: 1024px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    text-align: center;
  }
  .header-right {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .header-right {
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
  }
  .nav-links {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
  }
  .nav-btn {
    text-align: center;
    width: 100%;
    padding: 0.6rem;
  }
  .accessibility-bar {
    width: 100%;
    justify-content: center;
  }
  .prof-grid {
    grid-template-columns: 1fr;
  }
}
