/* ============================================
   INDEX PAGE STYLES - CASCADE OF HOPE HMS
   ============================================ */

/* Header & Navigation */
header {
  background: var(--bg-primary);
  box-shadow: var(--shadow-md);
  position: fixed;
  width: 100%;
  top: 0;
  z-index: var(--z-fixed);
  transition: box-shadow var(--transition-base);
}

nav {
  max-width: var(--container-xl);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-container img {
  height: 50px;
  width: auto;
}

.logo-text {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--primary-500);
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: var(--font-medium);
  transition: color var(--transition-fast);
}

.nav-links a:hover {
  color: var(--primary-500);
}

.login-btn {
  background: var(--primary-500);
  color: var(--text-inverse);
  padding: 0.7rem 1.8rem;
  border: none;
  border-radius: var(--radius-full);
  font-weight: var(--font-semibold);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  display: inline-block;
}

.login-btn:hover {
  background: var(--primary-600);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 102, 204, 0.3);
  color: var(--text-inverse);
}

/* Hero Section */
.hero {
  background: var(--bg-secondary);
  color: var(--text-primary);
  padding: 150px 2rem 100px;
  text-align: center;
  margin-top: 70px;
}

.hero h1 {
  font-size: var(--text-5xl);
  margin-bottom: 1rem;
  animation: fadeInDown 1s;
  color: var(--text-primary);
}

.hero p {
  font-size: var(--text-xl);
  margin-bottom: 2rem;
  opacity: 0.95;
  animation: fadeInUp 1s;
  color: var(--text-primary);
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 1.2s;
}

.btn-primary,
.btn-secondary {
  padding: 1rem 2.5rem;
  border: none;
  border-radius: var(--radius-full);
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: var(--primary-500);
  color: var(--text-inverse);
}

.btn-primary:hover {
  background: var(--primary-600);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 102, 204, 0.3);
  color: var(--text-inverse);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--primary-500);
}

.btn-secondary:hover {
  background: var(--primary-500);
  color: var(--text-inverse);
}

/* Features Section */
.features {
  background: var(--bg-secondary);
  padding: var(--space-20) var(--space-4);
}

.section-title {
  text-align: center;
  font-size: var(--text-4xl);
  color: var(--primary-500);
  margin-bottom: var(--space-12);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-8);
}

.feature-card {
  background: var(--bg-elevated);
  padding: var(--space-8);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  text-align: center;
  border: 1px solid var(--border-light);
}

.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-500);
}

.feature-icon {
  font-size: var(--text-5xl);
  margin-bottom: var(--space-4);
}

.feature-card h3 {
  color: var(--primary-500);
  margin-bottom: var(--space-4);
  font-size: var(--text-xl);
}

.feature-card p {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

/* Services Section */
.services {
  background: var(--bg-secondary);
  padding: var(--space-20) var(--space-4);
}

.services-container {
  max-width: var(--container-xl);
  margin: 0 auto;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-6);
  margin-top: var(--space-12);
}

.service-item {
  background: var(--bg-primary);
  padding: var(--space-6);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--primary-500);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.service-item:hover {
  transform: translateX(10px);
  box-shadow: var(--shadow-md);
}

.service-item h4 {
  color: var(--primary-500);
  margin-bottom: var(--space-2);
  font-size: var(--text-lg);
}

.service-item p {
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* ============================================
   TYPEWRITER EFFECT - FIXED VERSION
   ============================================ */

.typewriter-container {
  display: block;
  width: 100%;
  text-align: center;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 1.5em;
}

.typewriter-text {
  display: inline-block;
  color: var(--text-primary);
  line-height: 1.3;
  word-wrap: break-word;
  white-space: normal;
  max-width: 100%;
  position: relative;
  padding-right: 0.1em;
}

/* Blinking cursor - only shows during typing */
.typewriter-text.typing::after {
  content: '|';
  color: var(--primary-500);
  animation: blink 0.75s step-end infinite;
  position: absolute;
  right: -0.1em;
}

@keyframes blink {
  from, to { opacity: 1; }
  50% { opacity: 0; }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .typewriter-text.typing::after {
    animation: none;
  }
}

/* ============================================
   FOOTER STYLES
   ============================================ */

.footer {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-top: 1px solid var(--border-medium);
}

.footer-main {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: var(--space-16) var(--space-4) var(--space-8);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-8);
}

.footer-section h3 {
  color: var(--primary-500);
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-4);
}

.footer-section p {
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-4);
}

.footer-about {
  grid-column: span 1;
}

/* Footer Badges */
.footer-badges {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-top: var(--space-4);
}

.footer-badge {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--bg-primary);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
}

.footer-badge svg {
  width: 16px;
  height: 16px;
  color: var(--success);
}

.footer-badge span {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-primary);
}

/* Footer Links */
.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: var(--space-3);
}

.footer-links a {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
  font-size: var(--text-sm);
}

.footer-links a:hover {
  color: var(--primary-500);
  transform: translateX(5px);
}

.footer-links svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Footer Contact */
.footer-contact-item {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.footer-contact-item svg {
  width: 20px;
  height: 20px;
  color: var(--primary-500);
  flex-shrink: 0;
  margin-top: 2px;
}

.footer-contact-item div {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

/* Footer Social Links */
.footer-social {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.footer-social a:hover {
  background: var(--primary-500);
  color: var(--text-inverse);
  border-color: var(--primary-500);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.footer-social svg {
  width: 20px;
  height: 20px;
}

/* Footer Bottom */
.footer-bottom {
  background: var(--bg-primary);
  border-top: 1px solid var(--border-light);
  padding: var(--space-6) 0;
  margin-top: var(--space-8);
}

.footer-bottom-content {
  max-width: var(--container-xl);
  margin: 0 auto;
  padding: 0 var(--space-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-copyright {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin: 0;
}

.footer-bottom-links {
  display: flex;
  gap: var(--space-6);
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-bottom-links a {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-bottom-links a:hover {
  color: var(--primary-500);
  text-decoration: underline;
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
}

.menu-toggle span {
  width: 25px;
  height: 3px;
  background: var(--primary-500);
  transition: all var(--transition-fast);
  border-radius: var(--radius-sm);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    flex-direction: column;
    padding: var(--space-8);
    box-shadow: var(--shadow-lg);
    border-top: 1px solid var(--border-light);
  }

  .nav-links.active {
    display: flex;
  }

  .menu-toggle {
    display: flex;
  }

  .hero {
    padding: 120px 1rem 80px;
  }

  .hero h1 {
    font-size: var(--text-3xl);
  }

  .hero p {
    font-size: var(--text-lg);
  }

  .section-title {
    font-size: var(--text-3xl);
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .footer-bottom-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-bottom-links {
    flex-direction: column;
    gap: var(--space-3);
  }
}

@media (max-width: 640px) {
  nav {
    padding: 0.75rem 1rem;
  }

  .logo-text {
    font-size: var(--text-base);
  }

  .logo-container img {
    height: 40px;
  }

  .hero {
    padding: 100px 1rem 60px;
  }

  .hero h1 {
    font-size: var(--text-2xl);
  }

  .hero p {
    font-size: var(--text-base);
  }

  .btn-primary,
  .btn-secondary {
    padding: 0.75rem 1.5rem;
    font-size: var(--text-base);
  }

  .section-title {
    font-size: var(--text-2xl);
  }

  .features,
  .services {
    padding-left: var(--space-3);
    padding-right: var(--space-3);
  }

  .footer-main {
    padding: var(--space-12) var(--space-3) var(--space-6);
  }

  .footer-social a {
    width: 36px;
    height: 36px;
  }

  .footer-social svg {
    width: 18px;
    height: 18px;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  header {
    border-bottom: 1px solid var(--border-medium);
  }

  .feature-card,
  .service-item {
    background: var(--bg-elevated);
  }

  .footer-badge {
    background: var(--bg-secondary);
  }

  .footer-social a {
    background: var(--bg-secondary);
  }
}

[data-theme="dark"] {
  header {
    border-bottom: 1px solid var(--border-medium);
  }

  .feature-card,
  .service-item {
    background: var(--bg-elevated);
  }

  .footer-badge {
    background: var(--bg-secondary);
  }

  .footer-social a {
    background: var(--bg-secondary);
  }
}