/*
Theme Name: ListenCare
Theme URI: https://listencare.org
Author: ListenCare Dev
Description: Custom senior companionship platform - Landing, Family, Client & Admin portals
Version: 1.0.0
License: Private
Text Domain: listencare
*/

/* === CSS VARIABLES === */
:root {
  --navy: #1a365d;
  --navy-light: #234876;
  --teal: #0d9488;
  --teal-dark: #0f766e;
  --teal-light: #14b8a6;
  --mint: #d1fae5;
  --mint-light: #ecfdf5;
  --cream: #fefce8;
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --success: #059669;
  --warning: #d97706;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: Georgia, "Times New Roman", serif;
}

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--gray-900);
  background: var(--gray-50);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--teal); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--teal-dark); }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea {
  font-family: inherit; font-size: 1rem;
}

/* === UTILITIES === */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { max-width: 900px; }
.container-wide { max-width: 1400px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* === BUTTONS === */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.75rem 1.5rem; border-radius: var(--radius-sm);
  font-weight: 600; cursor: pointer; border: 2px solid transparent;
  transition: all 0.2s; text-decoration: none; line-height: 1.4;
}
.btn-primary {
  background: var(--teal); color: var(--white); border-color: var(--teal);
}
.btn-primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); color: var(--white); }
.btn-navy {
  background: var(--navy); color: var(--white); border-color: var(--navy);
}
.btn-navy:hover { background: var(--navy-light); border-color: var(--navy-light); color: var(--white); }
.btn-outline {
  background: transparent; color: var(--teal); border-color: var(--teal);
}
.btn-outline:hover { background: var(--mint-light); }
.btn-lg { padding: 1rem 2rem; font-size: 1.125rem; border-radius: var(--radius); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; }
.btn-block { width: 100%; }

/* === FORMS === */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block; margin-bottom: 0.5rem;
  font-weight: 600; color: var(--gray-700); font-size: 0.9375rem;
}
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 0.75rem 1rem;
  border: 2px solid var(--gray-200); border-radius: var(--radius-sm);
  background: var(--white); color: var(--gray-900);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}
.form-textarea { min-height: 120px; resize: vertical; }
.form-hint { font-size: 0.875rem; color: var(--gray-500); margin-top: 0.25rem; }
.form-error {
  background: var(--danger-light); color: var(--danger);
  padding: 0.75rem 1rem; border-radius: var(--radius-sm);
  border-left: 4px solid var(--danger); margin-bottom: 1rem;
}
.form-success {
  background: #ecfdf5; color: var(--success);
  padding: 0.75rem 1rem; border-radius: var(--radius-sm);
  border-left: 4px solid var(--success); margin-bottom: 1rem;
}

/* === CARDS === */
.card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.5rem;
  border: 1px solid var(--gray-200);
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem; padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
}
.card-title { font-size: 1.25rem; font-weight: 700; color: var(--navy); }

/* === BADGES === */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.25rem 0.75rem; border-radius: 9999px;
  font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-requested { background: #fef3c7; color: #92400e; }
.badge-matching { background: #dbeafe; color: #1e40af; }
.badge-confirmed { background: #d1fae5; color: #065f46; }
.badge-inprogress { background: #c7d2fe; color: #3730a3; }
.badge-completed { background: var(--mint); color: var(--teal-dark); }
.badge-cancelled { background: var(--danger-light); color: var(--danger); }

/* === TABLES === */
.table-wrap { overflow-x: auto; }
.table {
  width: 100%; border-collapse: collapse; font-size: 0.9375rem;
}
.table th, .table td {
  padding: 0.875rem 1rem; text-align: left; border-bottom: 1px solid var(--gray-200);
}
.table th {
  font-weight: 600; color: var(--gray-700); background: var(--gray-50);
  text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.05em;
}
.table tr:hover td { background: var(--gray-50); }

/* === HEADER === */
.site-header {
  background: var(--white); border-bottom: 1px solid var(--gray-200);
  position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.site-logo {
  font-size: 1.5rem; font-weight: 800; color: var(--navy); letter-spacing: -0.02em;
}
.site-logo span { color: var(--teal); }
.main-nav { display: flex; align-items: center; gap: 2rem; }
.main-nav a {
  color: var(--gray-700); font-weight: 500; font-size: 0.9375rem;
}
.main-nav a:hover { color: var(--teal); }
.nav-cta { display: flex; align-items: center; gap: 1rem; }
.mobile-menu-btn { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--navy); }

/* === FOOTER === */
.site-footer {
  background: var(--navy); color: #94a3b8; padding: 3rem 0 1.5rem;
  margin-top: auto;
}
.site-footer a { color: #cbd5e1; }
.site-footer a:hover { color: var(--white); }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; margin-bottom: 2rem; }
.footer-brand { font-size: 1.25rem; font-weight: 700; color: var(--white); margin-bottom: 0.5rem; }
.footer-title { font-weight: 600; color: var(--white); margin-bottom: 1rem; font-size: 0.9375rem; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 0.5rem; }
.footer-links a { font-size: 0.9375rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1); padding-top: 1.5rem;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
  font-size: 0.875rem;
}

/* === HERO === */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, #1e3a5f 100%);
  color: var(--white); padding: 5rem 0; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -50%; right: -10%; width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(13,148,136,0.2) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-content { position: relative; z-index: 1; max-width: 640px; }
.hero h1 {
  font-family: var(--font-heading); font-size: 3rem; line-height: 1.15;
  margin-bottom: 1.25rem; font-weight: 700;
}
.hero p { font-size: 1.25rem; color: #cbd5e1; margin-bottom: 2rem; line-height: 1.6; }
.hero-badges { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 2rem; }
.hero-badge {
  display: flex; align-items: center; gap: 0.5rem;
  background: rgba(255,255,255,0.1); backdrop-filter: blur(4px);
  padding: 0.5rem 1rem; border-radius: var(--radius-sm); font-size: 0.875rem;
}

/* === SECTIONS === */
.section { padding: 4rem 0; }
.section-alt { background: var(--white); }
.section-cream { background: var(--cream); }
.section-mint { background: var(--mint-light); }
.section-header { text-align: center; max-width: 640px; margin: 0 auto 3rem; }
.section-header h2 {
  font-family: var(--font-heading); font-size: 2.25rem; color: var(--navy);
  margin-bottom: 0.75rem;
}
.section-header p { color: var(--gray-500); font-size: 1.125rem; }

/* === SERVICES GRID === */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.service-card {
  background: var(--white); border-radius: var(--radius); padding: 2rem;
  box-shadow: var(--shadow); border: 1px solid var(--gray-200);
  transition: transform 0.2s, box-shadow 0.2s;
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.service-icon {
  width: 56px; height: 56px; background: var(--mint); color: var(--teal);
  border-radius: var(--radius); display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; margin-bottom: 1rem;
}
.service-card h3 { color: var(--navy); margin-bottom: 0.5rem; font-size: 1.125rem; }
.service-card p { color: var(--gray-500); font-size: 0.9375rem; }

/* === HOW IT WORKS === */
.steps { display: flex; gap: 2rem; counter-reset: step; }
.step { flex: 1; position: relative; padding-top: 3rem; }
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 0; left: 0;
  width: 40px; height: 40px; background: var(--teal); color: var(--white);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1rem;
}
.step h3 { color: var(--navy); margin-bottom: 0.5rem; font-size: 1.125rem; }
.step p { color: var(--gray-500); font-size: 0.9375rem; }

/* === PRICING === */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.pricing-card {
  background: var(--white); border-radius: var(--radius); padding: 2rem;
  box-shadow: var(--shadow); border: 2px solid var(--gray-200); text-align: center;
}
.pricing-card.featured { border-color: var(--teal); position: relative; }
.pricing-card.featured::before {
  content: 'Most Popular'; position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--teal); color: var(--white); padding: 0.25rem 1rem;
  border-radius: 9999px; font-size: 0.75rem; font-weight: 600;
}
.pricing-price { font-size: 2.5rem; font-weight: 800; color: var(--navy); }
.pricing-price span { font-size: 1rem; color: var(--gray-500); font-weight: 400; }
.pricing-features { list-style: none; margin: 1.5rem 0; }
.pricing-features li { padding: 0.5rem 0; color: var(--gray-700); border-bottom: 1px solid var(--gray-100); }

/* === LEAD FORM === */
.lead-form {
  background: var(--white); border-radius: var(--radius); padding: 2.5rem;
  box-shadow: var(--shadow-lg); max-width: 700px; margin: 0 auto;
}
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.form-grid .form-group:last-child { grid-column: 1 / -1; }

/* === DASHBOARD LAYOUT === */
.dashboard-layout { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.dashboard-sidebar {
  background: var(--navy); color: var(--white); padding: 1.5rem;
  position: fixed; width: 260px; height: 100vh; overflow-y: auto;
}
.sidebar-logo { font-size: 1.25rem; font-weight: 700; margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
.sidebar-logo span { color: var(--teal-light); }
.sidebar-nav { list-style: none; }
.sidebar-nav li { margin-bottom: 0.25rem; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem; border-radius: var(--radius-sm);
  color: #cbd5e1; font-size: 0.9375rem; font-weight: 500;
  transition: all 0.2s;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: rgba(255,255,255,0.1); color: var(--white);
}
.sidebar-nav .icon { width: 20px; text-align: center; }
.sidebar-footer { margin-top: auto; padding-top: 2rem; border-top: 1px solid rgba(255,255,255,0.1); }
.sidebar-user { font-size: 0.875rem; color: #94a3b8; margin-bottom: 1rem; }
.dashboard-main { margin-left: 260px; padding: 2rem; background: var(--gray-50); min-height: 100vh; }
.dashboard-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--gray-200);
}
.dashboard-header h1 { font-size: 1.5rem; color: var(--navy); }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.stat-card { background: var(--white); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); border-left: 4px solid var(--teal); }
.stat-card.navy { border-left-color: var(--navy); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.danger { border-left-color: var(--danger); }
.stat-value { font-size: 1.875rem; font-weight: 800; color: var(--navy); }
.stat-label { font-size: 0.875rem; color: var(--gray-500); margin-top: 0.25rem; }

/* === CLIENT PORTAL (Senior-Friendly) === */
.client-portal { background: var(--cream); min-height: 100vh; }
.client-header {
  background: var(--navy); color: var(--white); padding: 2rem 0; text-align: center;
}
.client-header h1 { font-size: 2.5rem; font-weight: 700; }
.client-header p { font-size: 1.25rem; color: #cbd5e1; margin-top: 0.5rem; }
.client-main { max-width: 800px; margin: 0 auto; padding: 2rem 1.5rem; }
.client-card {
  background: var(--white); border-radius: var(--radius); padding: 2rem;
  box-shadow: var(--shadow-md); margin-bottom: 1.5rem; border: 2px solid var(--gray-200);
}
.client-card h2 { color: var(--navy); font-size: 1.5rem; margin-bottom: 1rem; }
.client-card p { color: var(--gray-600); font-size: 1.125rem; }
.service-grid-large { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.service-btn-large {
  display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
  padding: 2rem 1rem; background: var(--white); border: 3px solid var(--gray-200);
  border-radius: var(--radius); cursor: pointer; transition: all 0.2s;
  font-size: 1.125rem; font-weight: 600; color: var(--navy);
}
.service-btn-large:hover, .service-btn-large:focus {
  border-color: var(--teal); background: var(--mint-light);
  outline: none; box-shadow: 0 0 0 4px rgba(13,148,136,0.2);
}
.service-btn-large .icon { font-size: 2.5rem; }
.visit-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.25rem; background: var(--gray-50); border-radius: var(--radius-sm);
  margin-bottom: 0.75rem; border-left: 4px solid var(--teal);
}
.visit-item.cancelled { border-left-color: var(--danger); }
.visit-item.completed { border-left-color: var(--success); }
.visit-item-info h4 { color: var(--navy); font-size: 1.125rem; }
.visit-item-info p { color: var(--gray-500); font-size: 0.9375rem; margin-top: 0.25rem; }

/* === ADMIN === */
.admin-badge {
  background: var(--danger); color: var(--white); font-size: 0.625rem;
  padding: 0.125rem 0.5rem; border-radius: 9999px; text-transform: uppercase;
  font-weight: 700; letter-spacing: 0.05em; margin-left: 0.5rem;
}
.admin-table-actions { display: flex; gap: 0.5rem; }
.admin-table-actions .btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.filter-bar {
  display: flex; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap;
  background: var(--white); padding: 1rem; border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.filter-bar .form-group { margin-bottom: 0; flex: 1; min-width: 180px; }

/* === AUTH PAGES === */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--navy) 0%, #1e3a5f 100%); padding: 2rem; }
.auth-box {
  background: var(--white); border-radius: var(--radius); padding: 2.5rem;
  box-shadow: var(--shadow-lg); width: 100%; max-width: 480px;
}
.auth-box h1 { color: var(--navy); font-size: 1.75rem; margin-bottom: 0.5rem; }
.auth-box .subtitle { color: var(--gray-500); margin-bottom: 1.5rem; }
.auth-links { text-align: center; margin-top: 1.5rem; font-size: 0.9375rem; color: var(--gray-500); }

/* === MODAL === */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--white); border-radius: var(--radius); padding: 2rem;
  width: 90%; max-width: 600px; max-height: 90vh; overflow-y: auto;
  transform: scale(0.95); transition: transform 0.2s;
}
.modal-overlay.active .modal { transform: scale(1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.modal-header h2 { color: var(--navy); }
.modal-close { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--gray-500); }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .dashboard-layout { grid-template-columns: 1fr; }
  .dashboard-sidebar { position: relative; width: 100%; height: auto; }
  .dashboard-main { margin-left: 0; }
  .steps { flex-direction: column; }
}
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 1rem; }
  .section-header h2 { font-size: 1.75rem; }
  .main-nav { display: none; }
  .mobile-menu-btn { display: block; }
  .form-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .client-header h1 { font-size: 1.75rem; }
  .service-grid-large { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .service-grid-large { grid-template-columns: 1fr; }
  .auth-box { padding: 1.5rem; }
}

/* === ACCESSIBILITY === */
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.skip-link {
  position: absolute; top: -40px; left: 0; background: var(--navy); color: var(--white);
  padding: 0.5rem 1rem; z-index: 1000; transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* === ANIMATIONS === */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.animate-fade-in { animation: fadeIn 0.4s ease-out; }
