/* Modern Custom Styles for OahiCare */

:root {
  /* Default Theme: Maroon */
  --primary: #800020;
  --primary-hover: #641b27;
  --primary-light: #f7e6e9;
  --secondary: #1E4620;
  --secondary-hover: #153317;
  --secondary-light: #ddece0;
  
  --ivory: #FDFBF7;
  --charcoal: #1A1A1A;
  --gold: #D4AF37;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Pre-defined Curated Themes classes applied to body */
body.theme-maroon {
  --primary: #800020;
  --primary-hover: #641b27;
  --primary-light: #f7e6e9;
  --secondary: #1E4620;
  --secondary-hover: #153317;
  --secondary-light: #ddece0;
}

body.theme-blue {
  --primary: #0F4C81;
  --primary-hover: #0a355c;
  --primary-light: #e6f0fa;
  --secondary: #F5A623;
  --secondary-hover: #d48e1b;
  --secondary-light: #fef4e6;
}

body.theme-green {
  --primary: #1E4620;
  --primary-hover: #153317;
  --primary-light: #ddece0;
  --secondary: #8B5A2B;
  --secondary-hover: #6e4620;
  --secondary-light: #f5ede6;
}

body.theme-charcoal {
  --primary: #1A1A1A;
  --primary-hover: #333333;
  --primary-light: #e5e5e5;
  --secondary: #5C5C5C;
  --secondary-hover: #444444;
  --secondary-light: #f2f2f2;
}

body.theme-saffron {
  --primary: #D95D39;
  --primary-hover: #b84c2d;
  --primary-light: #fdf0ec;
  --secondary: #2F4858;
  --secondary-hover: #223440;
  --secondary-light: #eaedf0;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--ivory);
  color: var(--charcoal);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Glassmorphism Navigation */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(253, 251, 247, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-text {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-tag {
  font-size: 0.75rem;
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-link {
  color: var(--charcoal);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  font-size: 0.95rem;
}

.nav-link:hover {
  color: var(--primary);
}

/* Common Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  font-size: 0.95rem;
  min-height: 48px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-light);
}

.btn-secondary:hover {
  background: var(--primary-light);
  filter: brightness(0.95);
}

.btn-forest {
  background: var(--secondary);
  color: #fff;
}

.btn-forest:hover {
  background: var(--secondary-hover);
}

/* Landing Page Section Hero */
.hero {
  padding: 4rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 768px) {
  .hero {
    grid-template-columns: 1.2fr 0.8fr;
    padding: 6rem 1.5rem;
  }
}

.hero-content h1 {
  font-size: 2.5rem;
  line-height: 1.2;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .hero-content h1 {
    font-size: 3.5rem;
  }
}

.hero-content p {
  font-size: 1.125rem;
  color: rgba(26, 26, 26, 0.8);
  margin-bottom: 2rem;
  max-width: 540px;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-image-container {
  position: relative;
}

.hero-image-card {
  background: white;
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.02);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Features grid */
.features-section {
  background: white;
  padding: 5rem 1.5rem;
  border-top: 1px solid var(--primary-light);
}

.section-container {
  max-width: 1200px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 1rem;
}

.section-header p {
  color: rgba(26, 26, 26, 0.6);
  max-width: 600px;
  margin: 0 auto;
}

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

@media (min-width: 768px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-card {
  background: var(--ivory);
  border-radius: 16px;
  padding: 2rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.05);
}

.feature-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 12px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.feature-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--primary);
}

.feature-card p {
  color: rgba(26, 26, 26, 0.7);
  font-size: 0.95rem;
}

/* Beart India contact block */
.contact-cta-section {
  padding: 5rem 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: white;
  text-align: center;
}

.contact-cta-section h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.contact-cta-section p {
  max-width: 600px;
  margin: 0 auto 2rem auto;
  opacity: 0.9;
}

/* App / Portal CSS */
.portal-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.portal-nav {
  background: white;
  border-bottom: 1px solid var(--primary-light);
  position: sticky;
  top: 0;
  z-index: 100;
}

.tab-nav {
  display: flex;
  border-bottom: 1px solid #eee;
  background: white;
  position: sticky;
  top: 73px;
  z-index: 90;
}

@media (max-width: 800px) {
  .tab-nav {
    top: 63px;
  }
}

.tab-btn {
  flex: 1;
  text-align: center;
  padding: 1rem;
  font-weight: 600;
  border: none;
  background: none;
  cursor: pointer;
  color: rgba(26, 26, 26, 0.6);
  border-bottom: 3px solid transparent;
  transition: var(--transition);
  font-size: 0.95rem;
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
  padding: 1.5rem;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.tab-content.active {
  display: block;
}

/* Forms CSS */
.form-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.02);
  border: 1px solid rgba(0,0,0,0.05);
  margin-bottom: 1.5rem;
}

.form-card h3 {
  font-size: 1.15rem;
  color: var(--primary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--primary-light);
  padding-bottom: 0.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 600px) {
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-grid-full {
    grid-column: span 2;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(26,26,26,0.8);
}

.form-group input,
.form-group select,
.form-group textarea {
  font-size: 1rem;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: #fff;
  transition: var(--transition);
  min-height: 48px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(128, 0, 32, 0.1);
}

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

/* Authentication Page */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 74px);
  padding: 1.5rem;
}

.login-card {
  background: white;
  border-radius: 20px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.06);
  border: 1px solid var(--primary-light);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-header h2 {
  font-size: 1.75rem;
  color: var(--primary);
  font-weight: 800;
}

.login-header p {
  font-size: 0.9rem;
  color: rgba(26, 26, 26, 0.6);
}

/* Dashboard list layout */
.dashboard-filter-bar {
  background: white;
  border-radius: 12px;
  padding: 0.75rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border: 1px solid rgba(0,0,0,0.05);
}

.search-col {
  width: 100%;
  position: relative;
}

.search-col input {
  width: 100%;
  min-height: 40px;
  padding: 0.5rem 1rem 0.5rem 2.25rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 0.9rem;
}

.search-col i,
.search-col svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(0,0,0,0.4);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.filters-actions-group {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  width: 100%;
  align-items: center;
}

.filter-dropdown-col {
  flex: 1;
  min-width: 0;
}

.filter-dropdown-col select {
  width: 100%;
  min-height: 40px;
  padding: 0.5rem 0.5rem;
  font-size: 0.85rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: white;
}

.actions-col {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-shrink: 0;
}

.actions-col button {
  min-height: 40px;
  width: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

@media (min-width: 800px) {
  .dashboard-filter-bar {
    flex-direction: row;
    align-items: center;
  }
  
  .search-col {
    flex: 1.5;
  }
  
  .filters-actions-group {
    flex: 2.5;
    width: auto;
  }
  
  .filter-dropdown-col select {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
  }
}


.search-input-wrapper {
  position: relative;
  flex: 1;
}

.search-input-wrapper input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 0.95rem;
  min-height: 48px;
}

.search-input-wrapper i,
.search-input-wrapper svg {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(0,0,0,0.4);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.filter-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.record-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
  transition: var(--transition);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.record-card:hover {
  border-color: var(--primary-light);
}

.record-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.record-title h4 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.record-title span {
  font-size: 0.8rem;
  color: rgba(0,0,0,0.4);
}

/* Status badges */
.status-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
  text-transform: uppercase;
}

.status-new { background: #e0f2fe; color: #0369a1; }
.status-contacted { background: #fef3c7; color: #b45309; }
.status-tour { background: #faf5ff; color: #6b21a8; }
.status-admitted { background: var(--secondary-light); color: var(--secondary); }
.status-waitlisted { background: #fee2e2; color: #b91c1c; }

.record-details {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: rgba(0, 0, 0, 0.7);
  margin-bottom: 1rem;
  border-bottom: 1px dashed #eee;
  padding-bottom: 1rem;
}

@media (min-width: 600px) {
  .record-details {
    grid-template-columns: repeat(2, 1fr);
  }
}

.detail-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.detail-item i,
.detail-item svg {
  color: var(--primary);
  margin-top: 3px;
  flex-shrink: 0;
  width: 16px !important;
  height: 16px !important;
}

.record-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.status-select-wrapper select {
  font-size: 0.85rem;
  padding: 0.4rem 2rem 0.4rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  min-height: 36px;
  background: white;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
}

.action-btn-sm {
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
  cursor: pointer;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.5);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 500px;
  position: relative;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: rgba(0,0,0,0.5);
}

/* Toast Notification */
#toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #333;
  color: white;
  padding: 0.85rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-weight: 500;
  z-index: 2000;
  transform: translateY(100px);
  opacity: 0;
  transition: var(--transition);
}

#toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Bilingual WhatsApp language selection dialog customization */
.whatsapp-modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.whatsapp-lang-btn {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--primary-light);
  background: var(--ivory);
  border-radius: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
}

.whatsapp-lang-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* Utility classes */
.text-center { text-align: center; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-4 { margin-top: 1rem; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.85rem; }
.font-bold { font-weight: 700; }
.color-muted { color: rgba(26,26,26,0.6); }

.badge-outline {
  border: 1px solid var(--primary-light);
  color: var(--primary);
  background: var(--primary-light);
}
.badge-active {
  background: var(--primary);
  color: white;
}

/* Mobile-first and responsive layout adaptations */
@media (max-width: 580px) {
  /* Header Button Optimizations */
  .nav-links button span {
    display: none;
  }
  .nav-links {
    gap: 0.5rem;
  }
  .nav-links button {
    padding: 0.5rem;
    min-width: 40px;
    min-height: 40px;
  }

  /* Compact Tabs Menu */
  .tab-btn {
    padding: 0.75rem 0.25rem;
    font-size: 0.8rem;
  }
  .tab-btn i,
  .tab-btn svg {
    display: block;
    margin: 0 auto 0.25rem auto !important;
  }

  /* Dashboard CRM Filters Grid */
  .filter-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    gap: 0.5rem;
  }
  .filter-buttons #btn-today-followups {
    grid-column: span 2;
    width: 100%;
  }
  .filter-buttons select,
  .filter-buttons #btn-export-csv {
    width: 100%;
    margin: 0;
  }

  /* Record Card Compactness */
  .record-card {
    padding: 1rem;
    border-radius: 12px;
  }
  .record-details {
    grid-template-columns: 1fr;
  }

  /* Record Actions Alignment */
  .record-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .status-select-wrapper select {
    width: 100%;
    min-height: 40px;
  }
  .action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
  }
  .action-buttons button {
    width: 100%;
    justify-content: center;
    min-height: 40px;
    padding: 0.5rem;
  }

  /* Modal Adaptability */
  .modal-content {
    padding: 1.25rem;
    border-radius: 12px;
  }

  /* Form Header Stacking */
  .intake-header-wrapper {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.5rem;
  }
  .intake-header-wrapper button {
    width: 100%;
  }
}

@media (max-width: 380px) {
  .logo-text span {
    font-size: 1.1rem;
  }
  .logo-tag {
    display: none;
  }
}

.whatsapp-lang-btn i,
.whatsapp-lang-btn svg {
  flex-shrink: 0;
  margin-left: 0.5rem;
}

/* Landing Page Header Responsiveness */
@media (max-width: 768px) {
  .logo-tag {
    display: none !important;
  }
  .nav-links .nav-link {
    display: none !important; /* Hide secondary links on mobile */
  }
}

@media (max-width: 500px) {
  .nav-container {
    padding: 0.75rem 1rem;
  }
  .logo-text {
    font-size: 1.15rem;
  }
  .logo-text span {
    font-size: 1.15rem;
  }
  .nav-links {
    gap: 0.4rem;
  }
  .nav-links .btn {
    padding: 0.4rem 0.75rem !important;
    min-height: 36px !important;
    font-size: 0.85rem !important;
  }
}
