/* Card Container */
.card-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* Default to 3 columns for desktop */
  gap: 30px;
  padding: 30px;
  animation: fadeInUp 1s ease-out both;
  max-width: 1200px;
  margin: 0 auto;
}

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

/* Responsif untuk Tablet dan Mobile */
/* For larger tablets or smaller screens */
@media (max-width: 1200px) {
  .card-container {
    grid-template-columns: repeat(2, 1fr); /* 2 columns for medium devices */
    padding: 20px; /* Reduce padding on medium devices */
  }
}

/* For mobile devices */
@media (max-width: 768px) {
  .card-container {
    grid-template-columns: 1fr; /* 1 column for mobile devices */
    padding: 15px; /* Smaller padding on mobile */
  }

  /* Adjust feature card padding on mobile for better fit */
  .feature-card {
    padding: 20px; /* Adjust padding to prevent overcrowding */
  }

  /* Adjust font size for headings on mobile */
  .feature-card h3 {
    font-size: 1.25rem; /* Slightly smaller heading on mobile */
  }

  .feature-card p {
    font-size: 1rem; /* Smaller text for mobile */
  }

  /* Ensure badges don't overflow and adjust font size */
  .badge {
    font-size: 0.9rem; /* Slightly smaller font for badges */
    padding: 6px 12px; /* Smaller padding for badges */
  }
}

/* Feature Card */
.feature-card {
  background-color: #ffffff;
  border-radius: 15px;
  border: 1px solid #e0e0e0;
  padding: 30px;
  transition: all 0.3s ease-in-out;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative; /* Added for positioning the badge absolutely */
  background: #ffffff;
  max-width: 100%;
}

/* Efek Hover pada Card */
.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  border-color: #bdbdbd;
}

.feature-card h3 {
  margin: 0 0 15px;
  font-size: 1.5rem;
  color: #333;
  font-weight: 600;
  line-height: 1.4;
  font-family: 'Montserrat', sans-serif;
  transition: color 0.3s ease;
}

.feature-card:hover h3 {
  color: #1e88e5;
}

.feature-card p {
  margin: 12px 0;
  color: #777;
  font-size: 1.1rem;
  line-height: 1.6;
  font-family: 'Inter', sans-serif;
}

/* Badge Styling */
.badge {
  position: absolute; /* Position it absolutely within the feature-card */
  top: 15px; /* Default top distance */
  right: 15px; /* Default right distance */
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  text-transform: capitalize;
  background-color: #00796b;
  z-index: 10; /* Ensure it appears on top of other elements */
}

/* Badge color classes */
.badge.pemula {
  background-color: #27ae60;
}

.badge.menengah {
  background-color: #f39c12;
}

.badge.bahaya {
  background-color: #e74c3c;
}

.badge.mahir {
  background-color: #8e44ad;
}

.badge.module {
  background-color: #16a085;
}

.badge.file {
  background-color: #34495e;
}

/* Ripple Effect */
.feature-card.clicked-effect {
  transform: scale(0.98);
  opacity: 0.85;
  transition: all 0.1s ease-in-out;
}

.feature-card::after {
  content: '';
  position: absolute;
  top: var(--ripple-y);
  left: var(--ripple-x);
  width: 100px;
  height: 100px;
  margin-top: -50px;
  margin-left: -50px;
  border-radius: 50%;
  transform: scale(0);
  opacity: 0.3;
  background: #00796b;
  transition: transform 0.5s, opacity 1s;
  pointer-events: none;
}

/* Efek Ripple untuk Card */
.feature-card.ripple::after {
  transform: scale(4);
  opacity: 0;
}

.feature-card {
  position: relative;
  overflow: hidden;
}

.ripple-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.15);
  pointer-events: none;
  transform: scale(0);
  opacity: 0;
}

.feature-card.rippling .ripple-circle {
  animation: ripple-grow 1s linear forwards;
}

@keyframes ripple-grow {
  0% {
    transform: scale(0);
    opacity: 0.4;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

/* Final Tuning for Elegance */
.feature-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease-in-out;
}

.feature-card h3,
.feature-card p {
  font-family: 'Inter', sans-serif;
}

.feature-card p {
  color: #777;
}

/* Responsif untuk Tablet dan Mobile */

/* For tablets and smaller screens */
@media (max-width: 1200px) {
  .badge {
    top: 10px; /* Slightly adjusted distance for tablets */
    right: 10px; /* Adjusted position */
    font-size: 0.9rem; /* Slightly smaller text for medium screens */
    padding: 6px 12px; /* Adjust padding for smaller screens */
  }
}

/* For mobile devices */
@media (max-width: 768px) {
  .badge {
    top: 10px; /* Keep it near the top */
    right: 10px; /* Keep it near the right */
    font-size: 0.85rem; /* Smaller text on mobile */
    padding: 5px 10px; /* Even smaller padding for mobile */
  }
}

/* For extra small mobile devices */
@media (max-width: 480px) {
  .badge {
    top: 8px; /* Move the badge slightly closer to the top on small screens */
    right: 8px; /* Move the badge closer to the right */
    font-size: 0.8rem; /* Further reduce the font size for small screens */
    padding: 4px 8px; /* Reduce padding for extra small screens */
  }
}
/* Style for the tutorial count display */
#tutorialCount {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 18px;
  color: #333;
  background-color: #f9f9f9;
  border: 1px solid #ccc;
  border-radius: 20px;
  padding: 12px 25px;
  max-width: 300px;
  margin: 30px auto;
  text-align: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

/* Slight hover effect to add some interaction */
#tutorialCount:hover {
  background-color: #eaeaea;
  border-color: #bbb;
  transform: translateY(-2px);
}
/* General styling for the Spin Random button */
.spin-random-button {
    padding: 10px 20px; /* Enough padding for a clean look */
    font-size: 16px; /* Slightly smaller font size for elegance */
    color: #fff; /* White text for contrast */
    background-color: #00796b; /* Elegant dark teal background */
    border: 2px solid #00796b; /* Subtle border */
    border-radius: 30px; /* Rounded corners for a smooth look */
    cursor: pointer; /* Show pointer cursor on hover */
    transition: all 0.3s ease; /* Smooth transition for hover effect */
    outline: none; /* Remove outline for better aesthetics */
}

/* Hover effect for the Spin Random button */
.spin-random-button:hover {
    background-color: #004d40; /* Darker teal on hover */
    border-color: #004d40; /* Darker border color on hover */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Add soft shadow on hover */
}

/* Focus effect (when the button is clicked or focused) */
.spin-random-button:focus {
    border-color: #004d40; /* Match the hover effect border color */
    box-shadow: 0 0 8px rgba(0, 128, 0, 0.2); /* Greenish glow effect on focus */
}

/* Style for the button when the page is small */
@media (max-width: 768px) {
    .spin-random-button {
        font-size: 14px; /* Slightly smaller font size on smaller screens */
    }
}
#spinRandomBtn:hover {
        background-color: #45a049;  /* Slightly darker green on hover */
        transform: scale(1.05);  /* Slightly enlarge the button on hover */
    }
/* Define the spin animation */
@keyframes spinEffect {
    0% {
        transform: rotate(0deg);  /* Start from 0 degrees */
    }
    50% {
        transform: rotate(1800deg);  /* 1800 degrees (5 full rotations) */
    }
    100% {
        transform: rotate(3600deg);  /* End at 3600 degrees (10 full rotations) */
    }
}

/* Add the spin effect to the button */
.spin-animation {
    animation: spinEffect 2s ease-in-out;  /* 2 seconds for the spinning effect */
    pointer-events: none;  /* Disable clicking while spinning */
}

/* Styling for the button remains the same */
#spinRandomBtn {
    padding: 10px 20px;
    font-size: 16px;
    color: white;
    background-color: #4CAF50;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    outline: none;
}
