/* Custom Styles for Edusourcerion Portal - DeFi Inspired Design */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Color Palette - Mint/Sage/Forest Green */
  --mint-50: #e8f4ed;
  --sage-light: #dce9e0;
  --sage-50: #f0f5f2;
  --sage-100: #d4e3d8;
  --sage-200: #b8d1be;
  --forest-medium: #4a6b54;
  --forest-dark: #1a3d2e;
  --forest-darker: #0f2920;
  --orange-start: #ff6b3d;
  --orange-end: #ff9068;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  background: var(--mint-50);
}

/* Custom Color Classes for Tailwind */
.bg-mint-50 {
  background-color: var(--mint-50);
}

.bg-sage-light {
  background-color: var(--sage-light);
}

.bg-sage-50 {
  background-color: var(--sage-50);
}

.bg-sage-100 {
  background-color: var(--sage-100);
}

.bg-sage-200 {
  background-color: var(--sage-200);
}

.bg-forest-medium {
  background-color: var(--forest-medium);
}

.bg-forest-dark {
  background-color: var(--forest-dark);
}

.bg-forest-darker {
  background-color: var(--forest-darker);
}

.text-forest-medium {
  color: var(--forest-medium);
}

.text-forest-dark {
  color: var(--forest-dark);
}

.text-forest-darker {
  color: var(--forest-darker);
}

.border-sage-200 {
  border-color: var(--sage-200);
}

.border-forest-dark {
  border-color: var(--forest-dark);
}

/* Glass Morphism Effect */
.glass-card {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(26, 61, 46, 0.1);
}

/* Gradient Backgrounds */
.bg-gradient-orange-green {
  background: linear-gradient(135deg, var(--orange-start) 0%, var(--forest-dark) 100%);
}

.bg-gradient-sage {
  background: linear-gradient(135deg, var(--sage-100) 0%, var(--mint-50) 100%);
}

/* Flip Card Animation */
.flip-card {
  perspective: 1000px;
  cursor: pointer;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flip-card-inner.flipped {
  transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.flip-card-back {
  transform: rotateY(180deg);
}

/* Expand Card Animation */
.expand-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.expand-card.expanded {
  grid-column: span 2;
}

@media (max-width: 768px) {
  .expand-card.expanded {
    grid-column: span 1;
  }
}

.card-content-collapsed,
.card-content-expanded {
  transition: opacity 0.3s ease;
}

/* Wireframe Background */
.wireframe-bg {
  width: 100%;
  height: 100%;
  background-image: repeating-linear-gradient(
      0deg,
      rgba(26, 61, 46, 0.03) 0px,
      transparent 1px,
      transparent 40px,
      rgba(26, 61, 46, 0.03) 41px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(26, 61, 46, 0.03) 0px,
      transparent 1px,
      transparent 40px,
      rgba(26, 61, 46, 0.03) 41px
    );
  background-size: 41px 41px;
}

/* Circuit Board Background */
.circuit-bg {
  width: 100%;
  height: 100%;
  background-image: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 40px,
      rgba(255, 255, 255, 0.02) 40px,
      rgba(255, 255, 255, 0.02) 80px
    );
  background-size: 400px 400px, 300px 300px, 80px 80px;
}

/* Cookie Popup */
.cookie-popup {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  animation: slideInUp 0.5s ease-out;
}

.cookie-popup.hidden {
  display: none;
}

@keyframes slideInUp {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Scroll to Top Button */
.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 54px;
  height: 54px;
  background: var(--forest-dark);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 24px rgba(26, 61, 46, 0.2);
  z-index: 1000;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  background: var(--forest-darker);
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(26, 61, 46, 0.3);
}

/* Fade In Animation */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background: var(--sage-50);
}

::-webkit-scrollbar-thumb {
  background: var(--forest-dark);
  border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--forest-darker);
}

/* Header Shadow on Scroll */
header.scrolled {
  box-shadow: 0 4px 24px rgba(26, 61, 46, 0.1);
}

/* Form Input Focus Effects */
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--forest-dark);
  background-color: white;
}

/* Button Hover Effects */
button,
a.button {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Card Hover Effects */
.hover\:scale-105:hover {
  transform: scale(1.05);
}

/* Mobile Menu Transition */
#mobileNav {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 0;
  overflow: hidden;
}

#mobileNav:not(.hidden) {
  max-height: 500px;
}

/* Section Spacing */
section {
  scroll-margin-top: 80px;
}

/* Responsive Typography */
@media (max-width: 768px) {
  h1 {
    font-size: 2.25rem;
  }

  h2 {
    font-size: 1.875rem;
  }

  h3 {
    font-size: 1.5rem;
  }

  .cookie-popup {
    bottom: 10px;
    right: 10px;
    left: 10px;
  }

  .scroll-to-top {
    width: 48px;
    height: 48px;
    bottom: 20px;
    right: 20px;
    font-size: 20px;
  }
}

/* Print Styles */
@media print {
  header,
  footer,
  .cookie-popup,
  .scroll-to-top,
  #burgerMenu,
  button {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  a {
    text-decoration: underline;
  }
}

/* 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;
}

/* Focus Visible for Keyboard Navigation */
*:focus-visible {
  outline: 2px solid var(--forest-dark);
  outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  button,
  a {
    border: 2px solid currentColor;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .flip-card-inner {
    transition: none;
  }

  .expand-card {
    transition: none;
  }
}

/* Additional Utility Classes */
.text-balance {
  text-wrap: balance;
}

.rounded-3xl {
  border-radius: 1.5rem;
}

/* Hover transitions for links and buttons */
a,
button {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Shadow utilities matching the design */
.shadow-custom {
  box-shadow: 0 4px 16px rgba(26, 61, 46, 0.08);
}

.shadow-custom-lg {
  box-shadow: 0 8px 32px rgba(26, 61, 46, 0.12);
}

/* Border utilities */
.border-sage-200 {
  border-color: var(--sage-200);
}

/* Gradient text effect */
.gradient-text {
  background: linear-gradient(135deg, var(--forest-dark), var(--forest-medium));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
