/* =========================================
   GLOBAL RESET & VARIABLES
========================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6c63ff;
  --secondary: #8b5cf6;
  --accent: #d946ef;
  --pink: #f472b6;
  --dark: #0a0e27;
  --darker: #050816;
  --light: #e8e9f3;
  --card-bg: rgba(255, 255, 255, 0.03);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--darker);
  color: var(--light);
  overflow-x: hidden;
  line-height: 1.6;
}

.eco-system-container {
  margin: 200px auto;
  padding: 10px 20px;
  max-width: 1400px;
}

/* Prevent horizontal scroll */
body {
  overflow-x: hidden;
}

/* =========================================
   BACKGROUND ELEMENTS
========================================= */
.mesh-background {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -3;
  background: radial-gradient(
      ellipse at 20% 30%,
      rgba(108, 99, 255, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 80% 70%,
      rgba(0, 217, 255, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 50% 50%,
      rgba(255, 101, 132, 0.1) 0%,
      transparent 50%
    );
  animation: meshMove 20s ease-in-out infinite;
}

@keyframes meshMove {
  0%,
  100% {
    transform: scale(1) translate(0, 0);
  }
  33% {
    transform: scale(1.1) translate(5%, 5%);
  }
  66% {
    transform: scale(0.9) translate(-5%, -5%);
  }
}

/* =========================================
   FLOATING PARTICLES
========================================= */
.floating-particles {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 2.5px;
  height: 2.5px;
  background: radial-gradient(circle, #00bfff, transparent);
  border-radius: 50%;
  opacity: 0.6;
  pointer-events: none;
  mix-blend-mode: screen;
  animation: floatParticle 20s infinite ease-in-out;
}

@keyframes floatParticle {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 0.7;
  }
  25% {
    transform: translate(10px, -20px) scale(1.05);
    opacity: 0.5;
  }
  50% {
    transform: translate(-20px, -35px) scale(1.1);
    opacity: 0.4;
  }
  75% {
    transform: translate(15px, -15px) scale(1.05);
    opacity: 0.6;
  }
  100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.7;
  }
}

/* =========================================
   ORBS & GRID OVERLAY
========================================= */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.6;
  z-index: -3;
  animation: floatOrb 20s ease-in-out infinite;
}

.orb-1 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(108, 99, 255, 0.4), transparent);
  top: -200px;
  left: -200px;
}

.orb-2 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(0, 217, 255, 0.3), transparent);
  bottom: -180px;
  right: -180px;
  animation-delay: 5s;
}

.orb-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255, 101, 132, 0.25), transparent);
  top: 50%;
  left: 50%;
  animation-delay: 10s;
}

@keyframes floatOrb {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(80px, -80px) scale(1.1);
  }
  50% {
    transform: translate(-40px, 60px) scale(0.9);
  }
  75% {
    transform: translate(120px, 40px) scale(1.05);
  }
}

.grid-overlay {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: -3;
  background-image: linear-gradient(
      rgba(108, 99, 255, 0.03) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(108, 99, 255, 0.03) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: gridScroll 25s linear infinite;
}

@keyframes gridScroll {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(50px, 50px);
  }
}

/* =========================================
   HEADER SECTION
========================================= */
.header-section {
  text-align: center;
  margin-bottom: 80px;
  animation: fadeInUp 1s ease-out;
  padding: 0 15px;
}

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

.header-section h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 900;
  margin-bottom: 1.5rem;
  background: linear-gradient(
    135deg,
    var(--primary),
    var(--secondary),
    var(--accent)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  word-wrap: break-word;
}

.pledge-badge {
  display: inline-block;
  background: rgba(244, 114, 182, 0.2);
  color: var(--pink);
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  border: 2px solid rgba(244, 114, 182, 0.3);
  font-size: 0.95rem;
  margin-top: 1rem;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(244, 114, 182, 0.7);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 20px 10px rgba(244, 114, 182, 0);
  }
}

/* =========================================
   CHART
========================================= */
/* Premium Chart Container */
.chart-container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 35px 25px;
  background: linear-gradient(
    135deg,
    rgba(40, 44, 60, 0.95),
    rgba(30, 34, 50, 0.98)
  );
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
}

/* Chart Title */
.chart-title {
  text-align: center;
  color: #ffffff;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 15px;
  font-family: "Inter", -apple-system, sans-serif;
}

#donationChart,
#womenChart {
  display: block;
  margin: 0 auto;
  transition: transform 0.3s ease;
  max-width: 100%;
  height: auto;
}

/* Tablet Styles */
@media (max-width: 768px) {
  .chart-container {
    max-width: 420px;
    padding: 30px 20px;
  }

  .chart-title {
    font-size: 18px;
    margin-bottom: 12px;
  }
}

/* Mobile Styles */
@media (max-width: 480px) {
  .chart-container {
    max-width: 340px;
    padding: 25px 15px;
    margin: 10px auto;
    border-radius: 20px;
  }

  .chart-title {
    font-size: 16px;
    margin-bottom: 10px;
  }
}

/* Extra Small Mobile */
@media (max-width: 360px) {
  .chart-container {
    max-width: 300px;
    padding: 20px 12px;
    border-radius: 16px;
  }

  .chart-title {
    font-size: 15px;
  }
}

/* Animation on load */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chart-container {
  animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================
   CARDS
========================================= */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: 25px;
  padding: 3rem;
  border: 1px solid rgba(108, 99, 255, 0.2);
  margin-bottom: 3rem;
  transition: all 0.4s ease;
  position: relative;
  max-width: 100%;
  word-wrap: break-word;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(108, 99, 255, 0.05),
    rgba(0, 217, 255, 0.05)
  );
  border-radius: 25px;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.card:hover::before {
  opacity: 1;
}

.card:hover {
  border-color: var(--primary);
  box-shadow: 0 25px 70px rgba(108, 99, 255, 0.4);
}

.card h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin-bottom: 1.5rem;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.gradient-text {
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #d946ef);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =========================================
   STATS GRID
========================================= */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.stat-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 2.5rem;
  border: 1px solid rgba(0, 217, 255, 0.2);
  text-align: center;
  transition: all 0.4s ease;
  position: relative;
  transform-style: preserve-3d;
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at center,
    rgba(0, 217, 255, 0.1),
    transparent
  );
  border-radius: 20px;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card:hover {
  border-color: var(--secondary);
  box-shadow: 0 20px 50px rgba(0, 217, 255, 0.4);
}

.stat-number {
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.8rem;
  word-wrap: break-word;
}

.stat-label {
  color: rgba(232, 233, 243, 0.7);
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  font-weight: 500;
}

/* =========================================
   CONTENT GRID
========================================= */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 2rem;
  align-items: start;
}

@media (max-width: 1024px) {
  .content-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    justify-items: center;
  }

  .content-grid > * {
    width: 100%;
    max-width: 600px;
  }
}

/* =========================================
   TABLES
========================================= */
.table-container {
  width: 100%;
  overflow-x: auto;
  overflow-y: auto;
  max-height: 400px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.02);
}

.table-container::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.table-container::-webkit-scrollbar-track {
  background: rgba(108, 99, 255, 0.1);
  border-radius: 10px;
}

.table-container::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 10px;
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
}

table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 15px;
  overflow: hidden;
}

thead {
  background: rgba(108, 99, 255, 0.2);
}

th,
td {
  padding: 1.2rem;
  text-align: left;
  border-bottom: 1px solid rgba(108, 99, 255, 0.1);
}

th {
  font-weight: 700;
  color: white;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

tbody tr {
  transition: all 0.3s ease;
}

tbody tr:hover {
  background: rgba(108, 99, 255, 0.15);
}

tfoot {
  background: rgba(0, 217, 255, 0.1);
  font-weight: 700;
}

/* =========================================
   CHART CONTAINER
========================================= */
.chart-container {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 2rem;
  border: 1px solid rgba(108, 99, 255, 0.2);
  height: 100%;
  overflow: hidden;
  width: 100%;
}

.chart-wrapper {
  position: relative;
  height: 350px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 100%;
}

@media (max-width: 768px) {
  .chart-container {
    margin: 0 auto;
  }

  .chart-wrapper {
    height: 280px;
  }
}

/* =========================================
   BUTTONS
========================================= */
.btn {
  padding: 0.5rem 1.5rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.4s ease;
  border: none;
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 300px;
  display: inline-block;
  text-align: center;
}

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  box-shadow: 0 10px 30px rgba(108, 99, 255, 0.3);
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn-primary:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(108, 99, 255, 0.5);
}

/* =========================================
   FORM CONTAINER
========================================= */
.form-container {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: 25px;
  padding: 3rem;
  border: 1px solid rgba(108, 99, 255, 0.2);
  margin: 2rem 0;
  display: none;
  animation: slideDown 0.4s ease-out;
  max-width: 100%;
}

.form-container.active {
  display: block;
}

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

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.8rem;
  color: rgba(232, 233, 243, 0.9);
  font-weight: 600;
  font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 1.2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(108, 99, 255, 0.2);
  border-radius: 15px;
  color: white;
  font-size: 1rem;
  transition: all 0.3s ease;
  font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(108, 99, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
}

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

/* =========================================
   EVENTS GRID
========================================= */
.events-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2rem;
}

.event-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 2rem;
  border: 1px solid rgba(244, 114, 182, 0.2);
  transition: all 0.4s ease;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.event-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--pink), var(--accent));
}

.event-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    circle at top left,
    rgba(244, 114, 182, 0.1),
    transparent
  );
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.event-card:hover::after {
  opacity: 1;
}

.event-card:hover {
  transform: translateX(5px);
}

.event-card h3 {
  color: white;
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  margin-bottom: 1rem;
  font-weight: 700;
  word-wrap: break-word;
}

.event-card p {
  color: rgba(232, 233, 243, 0.8);
  line-height: 1.6;
  margin-bottom: 0.5rem;
  word-wrap: break-word;
}

.event-date {
  color: var(--secondary);
  font-size: 0.9rem;
  margin-top: 1.2rem;
  font-weight: 600;
}

/* =========================================
   LOADING & SUCCESS MESSAGES
========================================= */
.loading {
  text-align: center;
  padding: 4rem;
  font-size: 1.3rem;
  color: var(--secondary);
  font-weight: 600;
}

.loading::after {
  content: "...";
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%,
  20% {
    content: ".";
  }
  40% {
    content: "..";
  }
  60%,
  100% {
    content: "...";
  }
}

.success-message {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  padding: 1.2rem;
  border-radius: 15px;
  border: 1px solid rgba(34, 197, 94, 0.3);
  margin-top: 1.5rem;
  display: none;
  font-weight: 600;
}

.success-message.active {
  display: block;
  animation: slideDown 0.4s ease-out;
}

/* =========================================
   REVEAL ANIMATION
========================================= */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================
   RESPONSIVE BREAKPOINTS
========================================= */

/* Large Tablets and Small Desktops */
@media (max-width: 1024px) {
  .eco-system-container {
    margin: 150px auto;
    padding: 10px 20px;
  }

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

  .card {
    padding: 2.5rem;
  }

  .chart-wrapper {
    height: 300px;
  }
}

/* Tablets */
@media (max-width: 768px) {
  .eco-system-container {
    margin: 120px auto;
    padding: 10px 15px;
  }

  .header-section {
    margin-bottom: 60px;
  }

  .header-section h1 {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
  }

  .pledge-badge {
    font-size: 0.85rem;
    padding: 0.7rem 1.3rem;
  }

  .card {
    padding: 2rem;
    border-radius: 20px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .stat-card {
    padding: 2rem;
  }

  .content-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    justify-items: center;
  }

  .content-grid > * {
    width: 100%;
    max-width: 100%;
  }

  table {
    font-size: 0.85rem;
  }

  th,
  td {
    padding: 0.9rem;
  }

  .chart-wrapper {
    height: 280px;
  }

  .form-container {
    padding: 2rem;
  }

  .btn {
    padding: 0.9rem 2rem;
    font-size: 0.95rem;
  }

  .events-grid {
    gap: 1.25rem;
  }

  .event-card {
    padding: 1.5rem;
  }

  .event-card:hover {
    transform: translateX(3px);
  }

  /* Reduce particle effects on tablets */
  .particle {
    width: 1.8px;
    height: 1.8px;
    opacity: 0.5;
  }

  .orb-1 {
    width: 350px;
    height: 350px;
  }

  .orb-2 {
    width: 300px;
    height: 300px;
  }

  .orb-3 {
    width: 250px;
    height: 250px;
  }
}

/* Mobile Devices */
@media (max-width: 480px) {
  .eco-system-container {
    margin: 100px auto;
    padding: 10px 15px;
  }

  .header-section {
    margin-bottom: 50px;
    padding: 0 10px;
  }

  .header-section h1 {
    font-size: clamp(1.5rem, 6vw, 2rem);
    margin-bottom: 1rem;
  }

  .pledge-badge {
    font-size: 0.8rem;
    padding: 0.6rem 1.2rem;
  }

  .card {
    padding: 1.5rem;
    border-radius: 18px;
    margin-bottom: 2rem;
  }

  .card h2 {
    font-size: clamp(1.3rem, 5vw, 1.6rem);
    margin-bottom: 1rem;
  }

  .stats-grid {
    gap: 1.25rem;
  }

  .stat-card {
    padding: 1.5rem;
  }

  .stat-number {
    font-size: clamp(2rem, 8vw, 2.5rem);
  }

  .stat-label {
    font-size: 0.95rem;
  }

  table {
    font-size: 0.8rem;
  }

  th,
  td {
    padding: 0.7rem 0.5rem;
  }

  .chart-wrapper {
    height: 250px;
  }

  .chart-container {
    padding: 1.5rem;
  }

  .form-container {
    padding: 1.5rem;
    border-radius: 20px;
  }

  .form-group {
    margin-bottom: 1.2rem;
  }

  .form-group label {
    font-size: 0.9rem;
    margin-bottom: 0.6rem;
  }

  .form-group input,
  .form-group textarea {
    padding: 1rem;
    font-size: 0.95rem;
  }

  .btn {
    padding: 0.85rem 1.8rem;
    font-size: 0.9rem;
    max-width: 100%;
  }

  .events-grid {
    gap: 1rem;
  }

  .event-card {
    padding: 1.25rem;
  }

  .event-card h3 {
    font-size: clamp(1rem, 4vw, 1.2rem);
  }

  .event-card p {
    font-size: 0.9rem;
  }

  .event-date {
    font-size: 0.85rem;
    margin-top: 1rem;
  }

  .loading {
    padding: 3rem;
    font-size: 1.1rem;
  }

  /* Minimal particle effects on mobile */
  .particle {
    width: 1.5px;
    height: 1.5px;
    opacity: 0.4;
  }

  .orb-1 {
    width: 300px;
    height: 300px;
  }

  .orb-2 {
    width: 250px;
    height: 250px;
  }

  .orb-3 {
    width: 200px;
    height: 200px;
  }

  .grid-overlay {
    background-size: 40px 40px;
  }
}

/* Extra Small Devices */
@media (max-width: 360px) {
  .eco-system-container {
    margin: 80px auto;
    padding: 10px 12px;
  }

  .header-section h1 {
    font-size: 1.4rem;
  }

  .pledge-badge {
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
  }

  .card {
    padding: 1.25rem;
  }

  .card h2 {
    font-size: 1.2rem;
  }

  .stat-card {
    padding: 1.25rem;
  }

  .stat-number {
    font-size: 2rem;
  }

  .stat-label {
    font-size: 0.9rem;
  }

  .event-card {
    padding: 1rem;
  }

  .event-card h3 {
    font-size: 1rem;
  }

  .btn {
    padding: 0.8rem 1.5rem;
    font-size: 0.85rem;
  }
}

/* Landscape Mode for Mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .eco-system-container {
    margin: 60px auto;
  }

  .header-section {
    margin-bottom: 40px;
  }

  .card {
    padding: 1.5rem;
  }

  .chart-wrapper {
    height: 200px;
  }
}

/* High Resolution Displays */
@media (min-width: 1920px) {
  .eco-system-container {
    max-width: 1600px;
  }
}
