/*-----------------------------------------------
  HOMEPAGE SPECIFIC STYLES
-----------------------------------------------*/

/* Soft Neural Gradient Background for Index Page */
body {
  background: linear-gradient(135deg,
      #f8f9fa 0%,
      #e3e8f0 25%,
      #dfe7f5 50%,
      #e8e3f0 75%,
      #f5f3f8 100%);
  background-attachment: fixed;
  background-size: 400% 400%;
  animation: neuralGradient 15s ease infinite;
}

@keyframes neuralGradient {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* Dark mode gradient */
body.dark {
  background: linear-gradient(135deg,
      #1a1a2e 0%,
      #1e1a33 25%,
      #1a1e33 50%,
      #221a33 75%,
      #1e1a2e 100%);
  background-attachment: fixed;
  background-size: 400% 400%;
  animation: neuralGradient 15s ease infinite;
}



/* Hero Popup Modal */
.hero-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-popup.show {
  opacity: 1;
  visibility: visible;
}

/* Add a wrapper for scrolling content if needed, but here we use hero-content */
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: white;
  width: 100%;
  max-width: 800px;
  /* Increased slightly */
  padding: 4rem 2rem;
  padding-top: 5rem;
  /* Extra top padding to avoid close button */
  padding-right: 4rem;
  /* Extra right padding to avoid close button */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-height: 100%;
  box-sizing: border-box;
  animation: heroFadeIn 1.4s cubic-bezier(0.4, 0, 0.2, 1);
  /* Hide scrollbar but allow functionality */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.hero-content::-webkit-scrollbar {
  display: none;
}

.hero-popup-content {
  position: relative;
  width: 95%;
  max-width: 1100px;
  height: 90%;
  max-height: 750px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
  background-size: 200% 200%;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.85) translateY(20px);
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: gradientMove 8s ease infinite;
  /* Ensure close button positioning context */
  isolation: isolate;
}

.hero-popup.show .hero-popup-content {
  transform: scale(1) translateY(0);
}

@keyframes gradientMove {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

.hero-particles {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(3px 3px at 20px 30px, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(2px 2px at 90px 40px, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(3px 3px at 160px 30px, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(2px 2px at 200px 100px, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 250px 60px, rgba(255, 255, 255, 0.3), transparent);
  background-repeat: repeat;
  background-size: 300px 300px;
  animation: particles 25s linear infinite;
  opacity: 0.8;
}

.hero-gradient {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg,
      rgba(102, 126, 234, 0.9) 0%,
      rgba(118, 75, 162, 0.85) 30%,
      rgba(240, 147, 251, 0.7) 60%,
      rgba(102, 126, 234, 0.9) 100%);
  animation: gradientShift 10s ease-in-out infinite;
  background-size: 200% 200%;
}

@keyframes particles {
  0% {
    transform: translateY(0px) translateX(0px);
  }

  50% {
    transform: translateY(-200px) translateX(50px);
  }

  100% {
    transform: translateY(-400px) translateX(0px);
  }
}

@keyframes gradientShift {
  0% {
    opacity: 1;
    background-position: 0% 50%;
  }

  50% {
    opacity: 0.85;
    background-position: 100% 50%;
  }

  100% {
    opacity: 1;
    background-position: 0% 50%;
  }
}



.hero-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
  /* Ensure above all content */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  /* Ensure button stays fixed relative to popup content */
  pointer-events: auto;
}

.hero-close-btn:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.15) rotate(90deg);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.5);
}

.hero-close-btn:active {
  transform: scale(1.05) rotate(90deg);
}

@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.hero-title {
  margin-bottom: 2rem;
}

.hero-title-main {
  display: block;
  font-size: 4.5rem;
  font-weight: 900;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #fff 0%, #f0f8ff 50%, #e0f0ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: titleGlow 4s ease-in-out infinite, titleShimmer 3s ease-in-out infinite;
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
  letter-spacing: -1px;
}

.hero-title-sub {
  display: block;
  font-size: 1.6rem;
  font-weight: 400;
  opacity: 0.95;
  letter-spacing: 3px;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  animation: subtitlePulse 3s ease-in-out infinite;
}

@keyframes titleGlow {

  0%,
  100% {
    filter: brightness(1) drop-shadow(0 0 20px rgba(255, 255, 255, 0.3));
  }

  50% {
    filter: brightness(1.3) drop-shadow(0 0 30px rgba(255, 255, 255, 0.5));
  }
}

@keyframes titleShimmer {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

@keyframes subtitlePulse {

  0%,
  100% {
    opacity: 0.95;
  }

  50% {
    opacity: 1;
  }
}

.hero-description {
  font-size: 1.25rem;
  line-height: 1.7;
  margin-bottom: 3.5rem;
  opacity: 0.95;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  font-weight: 300;
  letter-spacing: 0.3px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 4rem;
  margin-bottom: 3rem;
  padding: 2rem 0;
  /* Ensure stats don't overlap with close button */
  margin-right: 0;
  padding-right: 0;
}

.stat-item {
  text-align: center;
  animation: statFadeIn 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  animation-fill-mode: both;
  padding: 1.5rem 2rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  min-width: 140px;
}

.stat-item:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.stat-item:nth-child(1) {
  animation-delay: 0.3s;
}

.stat-item:nth-child(2) {
  animation-delay: 0.5s;
}

.stat-item:nth-child(3) {
  animation-delay: 0.7s;
}

@keyframes statFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.stat-number {
  display: block;
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #fff 0%, #e6f3ff 50%, #fff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: numberShimmer 3s ease-in-out infinite;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

@keyframes numberShimmer {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

.stat-label {
  font-size: 0.95rem;
  opacity: 0.9;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.hero-scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  animation: bounce 2s infinite;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.hero-scroll-indicator.hidden {
  opacity: 0;
  visibility: hidden;
}

.scroll-arrow {
  width: 24px;
  height: 24px;
  border-right: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(45deg);
  opacity: 0.7;
}

@keyframes bounce {

  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  50% {
    transform: translateX(-50%) translateY(-8px);
  }
}

/* Dark mode hero */
body.dark .hero-popup {
  background: rgba(0, 0, 0, 0.9);
}

body.dark .hero-popup-content {
  background: linear-gradient(135deg, #4c1d95 0%, #6b21a8 50%, #7c3aed 100%);
  background-size: 200% 200%;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

body.dark .hero-section {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

body.dark .hero-gradient {
  background: linear-gradient(45deg,
      rgba(76, 29, 149, 0.9) 0%,
      rgba(107, 33, 168, 0.85) 30%,
      rgba(124, 58, 237, 0.7) 60%,
      rgba(76, 29, 149, 0.9) 100%);
  background-size: 200% 200%;
}

body.dark .stat-item {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

body.dark .stat-item:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Medium screens - adjust for close button */
@media (max-width: 1024px) and (min-width: 769px) {
  .hero-content {
    padding-right: 4.5rem !important;
    /* Extra right padding for close button */
  }

  .hero-stats {
    gap: 2.5rem !important;
    /* Reduce gap slightly on medium screens */
  }
}

/* Mobile hero adjustments */
@media (max-width: 768px) {
  .hero-popup {
    padding: 10px;
    align-items: flex-start;
    padding-top: env(safe-area-inset-top, 10px);
  }

  .hero-popup-content {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: calc(100vh - 20px) !important;
    min-height: auto !important;
    border-radius: 16px !important;
    margin: 10px;
    padding: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    transform: scale(1) !important;
    /* Ensure close button positioning works correctly */
    position: relative;
  }

  .hero-popup.show .hero-popup-content {
    transform: scale(1) !important;
  }

  .hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2.5rem 1rem 1rem !important;
    /* Increased top padding for close btn space */
    text-align: center;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box;
    overflow-y: auto;
    height: 100%;
    position: relative;
    z-index: 1;
  }

  .hero-title-main {
    font-size: 2rem !important;
    /* Significantly smaller */
    line-height: 1.1;
    word-wrap: break-word;
    max-width: 100%;
    margin-bottom: 0.25rem !important;
  }

  .hero-title-sub {
    font-size: 0.9rem !important;
    opacity: 0.9;
  }

  .hero-description {
    font-size: 0.9rem !important;
    margin: 1rem 0 !important;
    line-height: 1.4 !important;
    max-width: 100% !important;
  }

  /* Optimize stats for mobile */
  .hero-stats {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 0.5rem;
  }

  .stat-item {
    flex: 1 1 90px;
    min-width: 80px;
    padding: 0.75rem 0.5rem;
    margin-bottom: 0;
  }

  .stat-number {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
  }

  .stat-label {
    font-size: 0.7rem;
    letter-spacing: 0.5px;
  }

  /* Ensure close button is positioned correctly on mobile */
  .hero-popup-content {
    /* Ensure proper positioning context for close button */
    position: relative !important;
  }

  .hero-popup-content .hero-close-btn {
    position: absolute !important;
    top: 15px !important;
    right: 15px !important;
    z-index: 100 !important;
    /* Ensure button stays visible above scrolling content */
    pointer-events: auto;
    /* Prevent button from being affected by transforms or animations */
    transform: none !important;
    /* Ensure button is always visible */
    visibility: visible !important;
    opacity: 1 !important;
    /* Ensure button doesn't overlap content */
    width: 36px !important;
    height: 36px !important;
    font-size: 1rem !important;
  }

  /* Adjust stats when disclaimer is present */
  .hero-content.has-disclaimer .hero-stats {
    margin-bottom: 1rem !important;
    gap: 0.75rem !important;
    padding: 0.75rem 0 !important;
  }

  .hero-content.has-disclaimer .hero-description {
    margin-bottom: 1rem !important;
  }

  /* Modern Mobile disclaimer section styling - integrated into hero popup */
  .hero-content .mobile-disclaimer-section {
    margin-top: 2rem !important;
    padding-top: 2rem !important;
    scroll-margin-top: 1rem;
    position: relative;
  }

  .hero-content .mobile-disclaimer-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    border-radius: 2px;
  }

  .hero-content .mobile-disclaimer-section .disclaimer-content-wrapper {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 1.75rem 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: disclaimerFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  }

  @keyframes disclaimerFadeIn {
    from {
      opacity: 0;
      transform: translateY(20px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .hero-content .mobile-disclaimer-section .disclaimer-icon {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 1rem;
    animation: iconPulse 2s ease-in-out infinite;
  }

  @keyframes iconPulse {

    0%,
    100% {
      transform: scale(1);
    }

    50% {
      transform: scale(1.1);
    }
  }

  .hero-content .mobile-disclaimer-section h2 {
    font-size: 1.5rem !important;
    margin-bottom: 1.25rem !important;
    color: white !important;
    font-weight: 700 !important;
    text-align: center;
    letter-spacing: -0.3px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  }

  .hero-content .mobile-disclaimer-section .disclaimer-text-content {
    font-size: 0.9rem !important;
    line-height: 1.7 !important;
    color: rgba(255, 255, 255, 0.95) !important;
    margin-bottom: 1.5rem !important;
    text-align: left;
  }

  .hero-content .mobile-disclaimer-section .disclaimer-text-content p {
    margin-bottom: 1rem !important;
    font-size: 0.9rem !important;
    line-height: 1.7 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  .hero-content .mobile-disclaimer-section .disclaimer-text-content p:last-child {
    margin-bottom: 0 !important;
  }

  .hero-content .mobile-disclaimer-section .disclaimer-acknowledge-btn {
    width: 100% !important;
    padding: 16px 24px !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.2) 100%) !important;
    border: 2px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 14px !important;
    color: white !important;
    font-size: 1.05rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    margin-top: 1.5rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  }

  .hero-content .mobile-disclaimer-section .disclaimer-acknowledge-btn:active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0.3) 100%) !important;
    transform: scale(0.98) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
  }

  .hero-content .mobile-disclaimer-section .disclaimer-acknowledge-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3) !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
  }

  .hero-title {
    margin-bottom: 1rem !important;
  }

  .hero-title-main {
    font-size: 1.8rem !important;
    line-height: 1.2 !important;
    margin-bottom: 0.3rem !important;
  }

  .hero-title-sub {
    font-size: 0.85rem !important;
    letter-spacing: 1px !important;
    line-height: 1.3 !important;
  }

  .hero-description {
    font-size: 0.9rem !important;
    line-height: 1.5 !important;
    margin-bottom: 1.5rem !important;
    padding: 0 0.5rem;
  }

  .hero-stats {
    flex-direction: row;
    gap: 1rem !important;
    margin-bottom: 1.5rem !important;
    flex-wrap: wrap;
    justify-content: space-around;
    padding: 1rem 0 !important;
  }

  .stat-item {
    flex: 1;
    min-width: 80px;
    max-width: 120px;
  }

  .stat-number {
    font-size: 1.5rem !important;
    margin-bottom: 0.3rem !important;
  }

  .stat-label {
    font-size: 0.7rem !important;
    line-height: 1.2 !important;
  }

  .hero-close-btn {
    top: 15px !important;
    right: 15px !important;
    width: 40px !important;
    height: 40px !important;
    font-size: 1.2rem !important;
    z-index: 100 !important;
    background: rgba(0, 0, 0, 0.3);
    /* Slightly darker for contrast on mobile */
    border-color: rgba(255, 255, 255, 0.2);
  }
}

/* Adjusted for better header/footer space and increased text size */
.cards-container {
  max-width: 1400px;
  /* Increased for 5-column layout */
  margin: 1rem auto 6rem;
  /* Added top margin to prevent overlap */
  padding: 2rem 1.5rem;
  /* Increased padding for better spacing */
  text-align: center;
  display: flex;
  flex-direction: column;
  min-height: auto;
  height: auto;
  opacity: 1;
  animation: cardsContainerFadeIn 1s ease-out 0.5s forwards;
}

@keyframes cardsContainerFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cards-container h2 {
  margin-top: 0;
  margin-bottom: 1.5rem;
  font-size: 2.2rem;
  text-align: center;
  font-weight: 600;
  color: var(--primary-color);
}

/* Desktop Page Title Branding */
.page-title {
  color: #4b5563 !important;
  /* Dark Grey */
}

/* Brand Highlight for Desktop */
.page-title .brand-highlight {
  color: #ff2d55 !important;
  /* Logic Pink */
}

body.dark .page-title {
  color: #ffffff !important;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  /* 5 columns for perfect symmetry */
  gap: 1.5rem;
  /* Increased gap for better breathing room */
  margin: 0 auto;
  max-width: 1400px;
  grid-auto-rows: auto !important;
}

#home-content .card {
  background-color: var(--info-bg);
  min-height: 260px;
  /* Increased for better spacing */
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 1.75rem 1.5rem;
  /* Increased padding for breathing room */
  border-radius: 10px;
  /* Slightly more rounded */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  /* Smooth transition for hover effects */
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: unset;
}

#home-content .card-link {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  text-indent: -9999px;
  overflow: hidden;
}

/* Hover styles will be defined after base styles */

#home-content .card i {
  font-size: 2.8rem;
  /* Slightly larger icons */
  margin-bottom: 1.2rem;
  color: var(--accent-color);
  transition: transform 0.3s ease;
  display: block;
  height: 75px;
  width: 75px;
  line-height: 75px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 0.5rem;
}

#home-content .card h3 {
  font-size: 1.15rem;
  /* Adjusted for 5-column layout */
  margin: 0.25rem 0 0.6rem;
  color: white;
  /* Changed to white for visibility on colored card backgrounds */
  font-weight: 600;
  line-height: 1.3;
  transition: color 0.3s ease;
  /* Smooth color transition */
}

#home-content .card p {
  font-size: 0.95rem;
  /* Slightly smaller but still readable */
  line-height: 1.5;
  color: var(--text-secondary);
  flex: 1;
  margin-bottom: 0.5rem;
  flex-grow: 0;
  transition: color 0.3s ease;
  /* Smooth color transition */
}

/* ===== HOVER EFFECTS - Must come after base styles ===== */
#home-content .card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 35px rgba(123, 44, 191, 0.4);
  /* Purple glow shadow */
  background: linear-gradient(135deg, #7B2CBF 0%, #9D4EDD 50%, #C77DFF 100%);
  /* Enhanced 3-color purple gradient */
  transition: all 0.3s ease;
}

#home-content .card:hover h3,
#home-content .card:hover p,
#home-content .card:hover .content-wrapper h3,
#home-content .card:hover .content-wrapper p,
#home-content .card:hover .card-link,
#home-content .card:hover a {
  color: white !important;
  transition: color 0.3s ease;
  /* Override gradient text effect */
  background: none !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: white !important;
  background-clip: initial !important;
}

/* Ensure ALL content wrapper elements change color */
#home-content .card:hover .content-wrapper * {
  color: white !important;
  background: none !important;
  -webkit-text-fill-color: white !important;
}

/* Extra specific rule for h3 title */
#home-content .card.protected-card:hover h3,
#home-content .card:hover .content-wrapper h3 {
  color: white !important;
  background: none !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: white !important;
  background-clip: initial !important;
}

#home-content .card:hover i {
  color: #FFFFFF !important;
  /* White icons for maximum contrast */
  transform: scale(1.15);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Dark mode adjustments */
body.dark #home-content .card {
  background-color: var(--info-bg);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

body.dark #home-content .card:hover {
  box-shadow: 0 12px 35px rgba(106, 13, 173, 0.5);
  /* Purple glow for dark mode */
  background: linear-gradient(135deg, #6A0DAD 0%, #8B3FBC 50%, #A855F7 100%);
  /* Enhanced 3-color purple gradient for dark mode */
}

body.dark #home-content .card:hover h3,
body.dark #home-content .card:hover p,
body.dark #home-content .card:hover .content-wrapper h3,
body.dark #home-content .card:hover .content-wrapper p,
body.dark #home-content .card:hover .card-link,
body.dark #home-content .card:hover a {
  color: white !important;
  /* Override gradient text effect */
  background: none !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: white !important;
  background-clip: initial !important;
}

/* Ensure content wrapper elements change color in dark mode */
body.dark #home-content .card:hover .content-wrapper * {
  color: white !important;
  background: none !important;
  -webkit-text-fill-color: white !important;
}

/* Extra specific rule for h3 title in dark mode */
body.dark #home-content .card.protected-card:hover h3,
body.dark #home-content .card:hover .content-wrapper h3 {
  color: white !important;
  background: none !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: white !important;
  background-clip: initial !important;
}

body.dark #home-content .card:hover i {
  color: #FFFFFF !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

body.dark #home-content .card h3 {
  color: var(--text-color);
}

body.dark #home-content .card i {
  color: var(--accent-color);
}

/* Media query for large screens - 3 columns */
@media (max-width: 1200px) {
  .cards-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }

  .cards-container {
    max-width: 1200px;
  }
}

/* Media query for medium screens - 2 columns */
@media (max-width: 992px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  #home-content .card {
    min-height: 230px;
  }

  #home-content .card i {
    height: 65px;
    width: 65px;
    line-height: 65px;
    margin-bottom: 0.9rem;
  }
}

/* Media query for small screens - 2 column layout */
@media (max-width: 768px) {
  .cards-container {
    margin: 0 auto 2rem !important;
    padding: 60px 0.75rem 1rem 0.75rem !important;
    /* Top padding for fixed page title, side padding for edge spacing */
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .cards-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.625rem !important;
    /* Slightly tighter gap */
    grid-auto-rows: auto !important;
    grid-auto-flow: row dense !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }

  /* Force single column for very small screens to avoid overflow */
  @media (max-width: 550px) {
    .cards-grid {
      grid-template-columns: 1fr !important;
      max-width: 400px !important;
      margin: 0 auto !important;
    }
  }

  /* Ensure cards maintain their natural document order - no reordering */
  #home-content .card:nth-child(1) {
    order: 1;
    grid-column: auto;
  }

  #home-content .card:nth-child(2) {
    order: 2;
    grid-column: auto;
  }

  #home-content .card:nth-child(3) {
    order: 3;
    grid-column: auto;
  }

  #home-content .card:nth-child(4) {
    order: 4;
    grid-column: auto;
  }

  #home-content .card:nth-child(5) {
    order: 5;
    grid-column: auto;
  }

  #home-content .card:nth-child(6) {
    order: 6;
    grid-column: auto;
  }

  #home-content .card:nth-child(7) {
    order: 7;
    grid-column: auto;
  }

  #home-content .card:nth-child(8) {
    order: 8;
    grid-column: auto;
  }

  #home-content .card:nth-child(9) {
    order: 9;
    grid-column: auto;
  }

  #home-content .card:nth-child(10) {
    order: 10;
    grid-column: auto;
  }

  .cards-container h2 {
    font-size: 1.4rem !important;
    margin-bottom: 0.75rem !important;
    padding: 0 0.5rem !important;
  }

  #home-content .card {
    height: auto !important;
    padding: 0.875rem 0.5rem !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    text-align: center !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    min-height: 110px !important;
    transition: all 0.3s ease !important;
    width: 100% !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
  }

  #home-content .card i {
    flex: 0 0 auto !important;
    height: 48px !important;
    width: 48px !important;
    line-height: 48px !important;
    margin: 0 auto 0.5rem auto !important;
    font-size: 1.9rem !important;
    display: block !important;
    color: var(--accent-color) !important;
    flex-shrink: 0 !important;
  }

  #home-content .card h3 {
    font-size: 0.9rem !important;
    margin: 0 !important;
    line-height: 1.3 !important;
    text-align: center !important;
    font-weight: 600 !important;
    color: white !important;
    /* Changed to white for visibility on colored backgrounds */
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
    width: 100% !important;
    padding: 0 0.25rem !important;
    box-sizing: border-box !important;
  }

  #home-content .card p {
    display: none !important;
    /* Hide descriptions on mobile - no room */
  }

  #home-content .card .content-wrapper {
    flex: 1 !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: center !important;
    min-height: 0 !important;
    max-height: none !important;
    width: 100% !important;
    gap: 0.3rem !important;
    box-sizing: border-box !important;
  }

  /* Keep hover effects */
  #home-content .card:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 8px 24px rgba(123, 44, 191, 0.35) !important;
  }
}

/* Extra small devices - still 2 columns */
@media (max-width: 480px) {
  .cards-container {
    padding: 60px 0.5rem 1rem 0.5rem !important;
    /* Top padding for fixed page title */
    margin: 0 auto 1rem !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .cards-grid {
    gap: 0.5rem !important;
    grid-template-columns: repeat(2, 1fr) !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }

  #home-content .card {
    padding: 0.75rem 0.4rem !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
    margin: 0 !important;
    min-height: 100px !important;
    border-radius: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  #home-content .card i {
    flex: 0 0 auto !important;
    height: 40px !important;
    width: 40px !important;
    line-height: 40px !important;
    font-size: 1.6rem !important;
    margin: 0 auto 0.4rem auto !important;
    display: block !important;
  }

  #home-content .card h3 {
    font-size: 0.8rem !important;
    margin: 0 !important;
    line-height: 1.25 !important;
    font-weight: 600 !important;
    color: white !important;
    /* Changed to white for visibility on colored backgrounds */
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    text-align: center !important;
    width: 100% !important;
    padding: 0 0.2rem !important;
    box-sizing: border-box !important;
  }

  #home-content .card p {
    display: none !important;
    /* Hide descriptions on small mobile - no room */
  }

  #home-content .card .content-wrapper {
    gap: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  #home-content .card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 6px 20px rgba(123, 44, 191, 0.3) !important;
  }
}

/* Override base card styles to make them more mobile-friendly */
#home-content .cards-grid {
  grid-auto-rows: auto !important;
}

#home-content .card {
  justify-content: flex-start;
  min-height: unset;
}

#home-content .card p {
  margin-bottom: 0.5rem;
  flex-grow: 0;
}

/* Add a class that will be applied after DOM is fully loaded */
.transitions-enabled #home-content .card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* App Store Link Styles */
.app-store-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
  color: var(--accent-color);
  font-weight: 600;
  text-decoration: none;
  padding: 8px 16px;
  background: rgba(var(--accent-rgb), 0.1);
  border-radius: 20px;
  transition: all 0.3s ease;
}

.app-store-link:hover {
  background: rgba(var(--accent-rgb), 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.2);
}

.app-store-link i {
  font-size: 1.2em;
}

body.dark .app-store-link {
  color: var(--accent-color);
  background: rgba(var(--accent-rgb), 0.15);
}

body.dark .app-store-link:hover {
  background: rgba(var(--accent-rgb), 0.25);
  box-shadow: 0 4px 12px rgba(var(--accent-rgb), 0.3);
}

@media (max-width: 768px) {
  .app-store-link {
    font-size: 0.9rem;
    padding: 6px 12px;
    margin-top: 8px;
  }
}