:root {
  --primary-color: #ff8c42;
  --primary-dark: #e67325;
  --secondary-color: #ffa566;
  --accent-color: #a8d5ba;
  --text-dark: #2c3e50;
  --text-light: #5a6c7d;
  --background: #fefefe;
  --card-background: #ffffff;
  --shadow: rgba(0, 0, 0, 0.08);
  --shadow-hover: rgba(0, 0, 0, 0.12);
  --border-radius: 16px;
  --transition: all 0.3s ease;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #fef9f6 0%, #f8f0ed 100%);
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Header Styles */
header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 2rem 0;
  box-shadow: 0 4px 20px var(--shadow);
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 500px;
  height: 500px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 1;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.logo {
  font-size: 3rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.header-buttons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.donate-button,
.contact-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border: none;
  cursor: pointer;
}

.donate-button {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
  color: white;
}

.donate-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
  background: linear-gradient(135deg, #ee5a5a 0%, #e04e4e 100%);
}

.contact-button {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
}

.contact-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 140, 66, 0.4);
  background: linear-gradient(135deg, var(--primary-dark) 0%, #d66a1a 100%);
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tagline {
  font-size: 1.2rem;
  opacity: 0.95;
  font-weight: 300;
}

/* Navigation */
nav {
  background: white;
  box-shadow: 0 2px 10px var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.nav-menu {
  display: flex;
  list-style: none;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nav-menu::-webkit-scrollbar {
  display: none;
}

.nav-menu li {
  flex-shrink: 0;
}

.nav-menu a {
  display: block;
  padding: 1.2rem 1.5rem;
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}

.nav-menu a:hover,
.nav-menu a.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  background: rgba(232, 146, 124, 0.05);
}

/* Main Content */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.section {
  display: none;
  animation: fadeIn 0.5s ease;
}

.section.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 3rem 0;
  margin-bottom: 3rem;
}

.hero-image {
  width: 100%;
  max-width: 800px;
  height: 400px;
  object-fit: cover;
  border-radius: var(--border-radius);
  box-shadow: 0 10px 40px var(--shadow);
  margin-bottom: 2rem;
}

.hero h2 {
  font-size: 2.5rem;
  color: var(--text-dark);
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
  color: var(--text-light);
  max-width: 700px;
  margin: 0 auto 2rem;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  padding: 1rem 2rem;
  border: none;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(232, 146, 124, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(232, 146, 124, 0.4);
}

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

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

/* Section Headers */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: 2.5rem;
  color: var(--text-dark);
  margin-bottom: 1rem;
}

.section-header p {
  font-size: 1.2rem;
  color: var(--text-light);
  max-width: 700px;
  margin: 0 auto;
}

/* Resource Cards */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.resource-card {
  background: var(--card-background);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: 0 4px 15px var(--shadow);
  transition: var(--transition);
  border-left: 4px solid var(--primary-color);
}

.resource-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px var(--shadow-hover);
}

.resource-card h3 {
  color: var(--primary-color);
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.resource-type {
  display: inline-block;
  background: var(--secondary-color);
  color: var(--primary-dark);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.resource-card p {
  color: var(--text-light);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.resource-services {
  margin: 1rem 0;
}

.service-tag {
  display: inline-block;
  background: var(--accent-color);
  color: var(--text-dark);
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.85rem;
  margin: 0.3rem 0.3rem 0.3rem 0;
}

.contact-info {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #f0f0f0;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
  color: var(--text-dark);
}

.contact-item a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.contact-item a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* Emergency Banner */
.emergency-banner {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
  color: white;
  padding: 2rem;
  border-radius: var(--border-radius);
  margin-bottom: 3rem;
  box-shadow: 0 4px 20px rgba(255, 107, 107, 0.3);
}

.emergency-banner h3 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.emergency-contacts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.emergency-contact {
  background: rgba(255, 255, 255, 0.2);
  padding: 1rem;
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.emergency-contact strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.emergency-contact a {
  color: white;
  text-decoration: none;
  font-size: 1.3rem;
  font-weight: 700;
  display: block;
  margin-top: 0.5rem;
}

/* AI Chat Section */
.chat-container {
  background: var(--card-background);
  border-radius: var(--border-radius);
  box-shadow: 0 4px 20px var(--shadow);
  overflow: hidden;
  max-width: 900px;
  margin: 0 auto;
  height: 600px;
  display: flex;
  flex-direction: column;
}

.chat-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.chat-header h3 {
  font-size: 1.5rem;
}

.chat-messages {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  background: #f9f9f9;
}

.message {
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1rem;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.message.user {
  flex-direction: row-reverse;
}

.message-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.message.user .message-avatar {
  background: var(--accent-color);
}

.message-content {
  background: white;
  padding: 1rem 1.5rem;
  border-radius: 18px;
  max-width: 70%;
  box-shadow: 0 2px 8px var(--shadow);
}

.message.user .message-content {
  background: var(--primary-color);
  color: white;
}

.message-content a {
  color: var(--primary-color);
  text-decoration: underline;
  font-weight: 600;
  transition: var(--transition);
}

.message-content a:hover {
  color: var(--primary-dark);
}

.message.user .message-content a {
  color: white;
  text-decoration: underline;
}

.message.user .message-content a:hover {
  opacity: 0.8;
}

.chat-input-container {
  padding: 1.5rem;
  background: white;
  border-top: 1px solid #e0e0e0;
  display: flex;
  gap: 1rem;
}

.chat-input {
  flex: 1;
  padding: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 25px;
  font-size: 1rem;
  outline: none;
  transition: var(--transition);
}

.chat-input:focus {
  border-color: var(--primary-color);
}

.chat-send-btn {
  padding: 1rem 2rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.chat-send-btn:hover {
  background: var(--primary-dark);
}

.api-setup-notice {
  background: #fff3cd;
  border: 2px solid #ffc107;
  border-radius: var(--border-radius);
  padding: 2rem;
  margin-bottom: 2rem;
  text-align: center;
}

.api-setup-notice h4 {
  color: #856404;
  margin-bottom: 1rem;
}

/* Info Cards */
.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.info-card {
  background: var(--card-background);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: 0 4px 15px var(--shadow);
  text-align: center;
  transition: var(--transition);
}

.info-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px var(--shadow-hover);
}

.info-card-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.info-card h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.info-card p {
  color: var(--text-light);
  line-height: 1.6;
}

/* Articles Section */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
}

.article-card {
  background: var(--card-background);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 4px 15px var(--shadow);
  transition: var(--transition);
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px var(--shadow-hover);
}

.article-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.article-content {
  padding: 1.5rem;
}

.article-card h3 {
  color: var(--text-dark);
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.article-card p {
  color: var(--text-light);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.read-more {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.read-more:hover {
  color: var(--primary-dark);
  gap: 0.8rem;
}

/* Footer */
footer {
  background: var(--text-dark);
  color: white;
  padding: 3rem 2rem 2rem;
  margin-top: 4rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h4 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

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

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: var(--transition);
}

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

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
}

/* Responsive Design */
@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  .tagline {
    font-size: 1rem;
  }

  .hero h2 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .section-header h2 {
    font-size: 2rem;
  }

  .resource-grid {
    grid-template-columns: 1fr;
  }

  .nav-menu {
    justify-content: flex-start;
  }

  .message-content {
    max-width: 85%;
  }

  .chat-container {
    height: 500px;
  }

  .cta-buttons {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

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

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Focus Styles */
a:focus,
button:focus,
input:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}