/* ==========================================================================
   APP-FACTORY DESIGN SYSTEM
   CSS Custom Properties + Base Styles + Component Classes

   This file is the foundation for all generated apps. The LLM customizes
   the :root variables per brand but uses these classes and patterns.
   ========================================================================== */

/* --- DESIGN TOKENS --- */
:root {
  /* Colors — Malayali Matrimony Connect Brand */
  --color-primary: #0F766E;
  --color-primary-hover: #115E59;
  --color-primary-light: #CCFBF1;
  --color-secondary: #F8FAFC;
  --color-bg: #ffffff;
  --color-bg-subtle: #f8fafc;
  --color-bg-muted: #f1f5f9;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-text-inverse: #ffffff;
  --color-border: #e2e8f0;
  --color-success: #16a34a;
  --color-error: #dc2626;

  /* Typography */
  --font-sans: 'Poppins', system-ui, sans-serif;
  --font-heading: var(--font-sans);
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;
  --text-5xl: 3rem;

  /* Spacing scale (8px base) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Surfaces */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

  /* Layout */
  --container-max: 1200px;
  --content-max: 65ch;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-hover);
}

/* --- TYPOGRAPHY --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p {
  max-width: var(--content-max);
}

.text-muted {
  color: var(--color-text-muted);
}

.text-center {
  text-align: center;
}

.text-center p {
  margin-left: auto;
  margin-right: auto;
}

/* --- LAYOUT --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
}

.section {
  padding: var(--space-20) 0;
}

.section:nth-child(even) {
  background-color: var(--color-bg-subtle);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-header h2 {
  margin-bottom: var(--space-4);
}

.section-header p {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  margin-left: auto;
  margin-right: auto;
}

/* Grid */
.grid {
  display: grid;
  gap: var(--space-8);
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
}

/* Flex utilities */
.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* --- NAVIGATION --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-4) 0;
  backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.95);
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
}

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

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
  list-style: none;
}

.nav-links a {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--color-primary);
}

.nav-cta {
  display: inline-flex;
}

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
  color: var(--color-text);
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  margin: 5px 0;
  transition: var(--transition-base);
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-6);
    gap: var(--space-4);
    box-shadow: var(--shadow-lg);
  }

  .nav-links.open {
    display: flex;
  }
}

/* --- HERO --- */
.hero {
  padding: var(--space-24) 0;
  text-align: center;
}

.hero h1 {
  margin-bottom: var(--space-6);
}

.hero p {
  font-size: var(--text-xl);
  color: var(--color-text-muted);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-8);
}

.hero-split {
  padding: var(--space-20) 0;
}

.hero-split .container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-12);
  align-items: center;
}

.hero-split .hero-content h1 {
  margin-bottom: var(--space-6);
  text-align: left;
}

.hero-split .hero-content p {
  text-align: left;
  margin-bottom: var(--space-8);
}

.hero-split .hero-image img {
  width: 100%;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
}

@media (max-width: 768px) {
  .hero {
    padding: var(--space-16) 0;
  }

  .hero h1 {
    font-size: var(--text-3xl);
  }

  .hero-split .container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-split .hero-content h1,
  .hero-split .hero-content p {
    text-align: center;
  }

  .hero-split .hero-image {
    order: -1;
  }
}

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  gap: var(--space-2);
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  color: var(--color-text-inverse);
}

.btn-secondary {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

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

.btn-lg {
  min-height: 56px;
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
  border-radius: var(--radius-lg);
}

.btn-sm {
  min-height: 36px;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

/* --- CARDS --- */
.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  transition: box-shadow var(--transition-base);
}

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

.card-image {
  margin: calc(-1 * var(--space-8));
  margin-bottom: var(--space-6);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
}

.card h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
}

.card p {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.card-icon {
  width: 48px;
  height: 48px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
  margin-bottom: var(--space-4);
}

.card-price {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-primary);
  margin-top: var(--space-4);
}

/* --- FORMS --- */
.form-group {
  margin-bottom: var(--space-6);
}

.form-group label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: var(--color-text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  min-height: 48px;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

@media (max-width: 640px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-error {
  color: var(--color-error);
  font-size: var(--text-sm);
  margin-top: var(--space-1);
}

.form-success {
  background: #f0fdf4;
  color: var(--color-success);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  font-weight: 500;
  text-align: center;
}

/* --- BADGES --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.badge-secondary {
  background: var(--color-bg-muted);
  color: var(--color-text-muted);
}

/* --- TESTIMONIALS --- */
.testimonial-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
}

.testimonial-card blockquote {
  font-size: var(--text-lg);
  font-style: italic;
  color: var(--color-text);
  margin-bottom: var(--space-6);
  line-height: 1.7;
}

.testimonial-card blockquote::before {
  content: "\201C";
  font-size: var(--text-4xl);
  color: var(--color-primary);
  line-height: 0;
  vertical-align: -0.4em;
  margin-right: var(--space-1);
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.testimonial-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-lg);
}

.testimonial-author strong {
  display: block;
  font-size: var(--text-sm);
}

.testimonial-author span {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* --- PRICING TABLE --- */
.pricing-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  text-align: center;
  transition: box-shadow var(--transition-base);
}

.pricing-card:hover {
  box-shadow: var(--shadow-xl);
}

.pricing-card.featured {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-lg);
  position: relative;
}

.pricing-card.featured::before {
  content: "Most Popular";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
}

.pricing-name {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

.pricing-price {
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-6);
}

.pricing-price span {
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--color-text-muted);
}

.pricing-features {
  list-style: none;
  margin-bottom: var(--space-8);
  text-align: left;
}

.pricing-features li {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.pricing-features li::before {
  content: "\2713";
  color: var(--color-success);
  font-weight: 700;
  margin-right: var(--space-3);
}

/* --- CTA BANNER --- */
.cta-banner {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-20) 0;
  text-align: center;
}

.cta-banner h2 {
  color: var(--color-text-inverse);
  margin-bottom: var(--space-4);
}

.cta-banner p {
  color: rgba(255, 255, 255, 0.85);
  font-size: var(--text-lg);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-8);
}

.cta-banner .btn {
  background: var(--color-bg);
  color: var(--color-primary);
  border-color: var(--color-bg);
}

.cta-banner .btn:hover {
  background: var(--color-primary-light);
}

/* --- LOCATION / MAP --- */
.location-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  align-items: start;
}

.location-grid iframe {
  width: 100%;
  height: 350px;
  border: none;
  border-radius: var(--radius-lg);
}

.location-info h3 {
  margin-bottom: var(--space-6);
}

.location-detail {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.location-detail .icon {
  font-size: var(--text-xl);
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.location-detail p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.location-detail a {
  color: var(--color-primary);
  font-weight: 500;
}

@media (max-width: 768px) {
  .location-grid {
    grid-template-columns: 1fr;
  }
}

/* --- FAQ / ACCORDION --- */
.faq-item {
  border-bottom: 1px solid var(--color-border);
}

.faq-question {
  width: 100%;
  background: none;
  border: none;
  padding: var(--space-6) 0;
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-question::after {
  content: "+";
  font-size: var(--text-2xl);
  font-weight: 300;
  color: var(--color-text-muted);
  transition: transform var(--transition-fast);
}

.faq-item.open .faq-question::after {
  content: "\2212";
}

.faq-answer {
  display: none;
  padding-bottom: var(--space-6);
  color: var(--color-text-muted);
  line-height: 1.7;
}

.faq-item.open .faq-answer {
  display: block;
}

/* --- FOOTER --- */
.footer {
  background: var(--color-text);
  color: rgba(255, 255, 255, 0.7);
  padding: var(--space-16) 0 var(--space-8);
}

.footer a {
  color: rgba(255, 255, 255, 0.7);
  transition: color var(--transition-fast);
}

.footer a:hover {
  color: #ffffff;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-10);
  margin-bottom: var(--space-12);
}

.footer-brand {
  font-size: var(--text-xl);
  font-weight: 700;
  color: #ffffff;
  margin-bottom: var(--space-4);
}

.footer-col h4 {
  color: #ffffff;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-4);
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: var(--space-3);
}

.footer-col a {
  font-size: var(--text-sm);
}

.footer-social {
  display: flex;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  font-size: var(--text-lg);
  transition: background var(--transition-fast);
}

.footer-social a:hover {
  background: var(--color-primary);
  color: #ffffff;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: var(--space-8);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm);
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }
}

@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* --- MODAL --- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--color-bg);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
}

.modal-close {
  background: none;
  border: none;
  font-size: var(--text-2xl);
  cursor: pointer;
  color: var(--color-text-muted);
  padding: var(--space-2);
}

/* --- UTILITY --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.hidden {
  display: none !important;
}

/* Responsive text sizes */
@media (max-width: 768px) {
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  h3 { font-size: var(--text-xl); }

  .section {
    padding: var(--space-12) 0;
  }
}

/* --- APP-SPECIFIC STYLES --- */

/* Profile cards for browse page */
.profile-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: box-shadow var(--transition-base);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.profile-card:hover {
  box-shadow: var(--shadow-lg);
}

.profile-header {
  display: flex;
  gap: var(--space-4);
  align-items: center;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--text-2xl);
  flex-shrink: 0;
}

.profile-info {
  flex: 1;
}

.profile-info h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-1);
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.profile-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.profile-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

/* Search and filter section */
.search-filter {
  background: var(--color-bg-subtle);
  padding: var(--space-8);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-8);
}

.filter-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

/* Auth tabs */
.auth-tabs {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
  border-bottom: 2px solid var(--color-border);
}

.auth-tab {
  background: none;
  border: none;
  padding: var(--space-4) var(--space-6);
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition-fast);
}

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

.auth-content {
  display: none;
}

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

.auth-form {
  max-width: 500px;
  margin: 0 auto;
}
