/**
 * UM-CyberSafe - Core Modules Styles
 * Styles for the core modules pages
 */

:root {
  --primary-color: #0056b3;
  --secondary-color: #003d82;
  --accent-color: #ff6b6b;
  --success-color: #4CAF50;
  --warning-color: #ffc107;
  --text-color: #333;
  --light-bg: #f8f9fa;
  --white: #ffffff;
  --header-height: 80px;
}

/* Main Content */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 20px;
  margin-top: var(--header-height);
}

.page-title {
  text-align: center;
  margin-bottom: 3rem;
}

.page-title h1 {
  color: var(--primary-color);
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.page-title p {
  color: var(--text-color);
  font-size: 1.2rem;
  max-width: 800px;
  margin: 0 auto;
}

/* Module Cards */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.module-card {
  background: var(--white);
  border-radius: 10px;
  padding: 2rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  position: relative;
}

.module-card:hover {
  transform: translateY(-5px);
}

/* Highlight effect for when a module card is clicked from progress indicator */
@keyframes highlight-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 86, 179, 0.7);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(0, 86, 179, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 86, 179, 0);
  }
}

.module-card.highlight-card {
  animation: highlight-pulse 1.5s ease-out;
  border-color: var(--primary-color);
  transform: translateY(-5px);
}

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

.module-card p {
  margin-bottom: 1.5rem;
  color: var(--text-color);
}

.module-card .objectives {
  margin-bottom: 1.5rem;
}

.module-card .objectives h3 {
  color: var(--primary-color);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.module-card .objectives ul {
  list-style: none;
  padding-left: 1.5rem;
}

.module-card .objectives li {
  margin-bottom: 0.5rem;
  position: relative;
}

.module-card .objectives li:before {
  content: "✓";
  color: var(--success-color);
  position: absolute;
  left: -1.5rem;
}

.start-btn {
  display: inline-block;
  background: var(--primary-color);
  color: var(--white);
  padding: 0.8rem 1.5rem;
  border-radius: 5px;
  text-decoration: none;
  transition: background-color 0.3s ease;
  font-weight: 500;
}

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

/* Progress Indicator */
.progress-container {
  margin: 2rem 0 3rem 0;
  text-align: center;
  background: var(--white);
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.progress-steps {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.progress-step {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  background: var(--white);
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.progress-step:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.progress-step:active {
  transform: translateY(-1px);
}

.progress-step::after {
  content: "Click to view";
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 10px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}

html[lang="ms"] .progress-step::after {
  content: "Klik untuk lihat";
}

.progress-step:hover::after {
  opacity: 1;
  visibility: visible;
}

.progress-step.completed {
  background: var(--primary-color);
  color: var(--white);
}

.progress-bar {
  width: 100%;
  max-width: 600px;
  height: 10px;
  background: var(--light-bg);
  border-radius: 5px;
  margin: 1rem auto;
  overflow: hidden;
}

.progress {
  height: 100%;
  background: var(--primary-color);
  width: 0%;
  transition: width 0.3s ease;
}

.module-card.completed {
  border: 2px solid var(--success-color);
  background: rgba(76, 175, 80, 0.05);
}

.module-card.completed::after {
  content: '✓';
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--success-color);
  color: var(--white);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.module-card.completed h2 {
  color: var(--success-color);
}

.module-card.completed .start-btn {
  background: var(--success-color);
}

.module-card.completed .start-btn:hover {
  background: #45a049;
}

/* Add style for the progress text */
#progress-text, #bonus-progress-text {
  margin-top: 0.5rem;
  font-weight: 500;
  color: var(--text-color);
}

/* Section Headers */
.section-header {
  text-align: center;
  margin: 2rem 0;
  padding: 1rem;
  background: var(--white);
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.section-header h2 {
  color: var(--primary-color);
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.section-header p {
  color: var(--text-color);
  font-size: 1.1rem;
}

/* Progress Colors */
.module-card.beginner-completed {
  border-left: 4px solid #ffc107;
}

.module-card.intermediate-completed {
  border-left: 4px solid #ff9800;
}

.module-card.expert-completed {
  border-left: 4px solid #4CAF50;
}

.module-card.beginner-completed .start-btn {
  background: #ffc107;
}

.module-card.intermediate-completed .start-btn {
  background: #ff9800;
}

.module-card.expert-completed .start-btn {
  background: #4CAF50;
}

.module-card.beginner-completed .start-btn:hover {
  background: #ffa000;
}

.module-card.intermediate-completed .start-btn:hover {
  background: #f57c00;
}

.module-card.expert-completed .start-btn:hover {
  background: #388e3c;
}

/* Progress Step Colors */
/* Yellow for beginner level completed */
.progress-step.beginner-completed {
  background-color: #ffc107;
  border: 2px solid #ffc107;
  color: #333;
}

/* Orange for intermediate level completed */
.progress-step.intermediate-completed {
  background-color: #fd7e14;
  border: 2px solid #fd7e14;
  color: white;
}

/* Green for all levels completed */
.progress-step.all-completed {
  background-color: #28a745;
  border: 2px solid #28a745;
  color: white;
}

/* Default completed state (if no level class is applied) */
.progress-step.completed {
  background-color: var(--primary-color);
  border: 2px solid var(--primary-color);
  color: white;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .container {
    padding: calc(var(--header-height) + 1rem) 15px 2rem;
  }

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

  .page-title h1 {
    font-size: 1.8rem;
    line-height: 1.2;
    padding: 0 1rem;
  }

  .page-title p {
    font-size: 1rem;
    padding: 0 1rem;
  }

  .progress-container {
    padding: 1rem;
    margin: 1.5rem 0;
  }

  .progress-steps {
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0 1rem;
  }

  .progress-step {
    width: 30px;
    height: 30px;
    font-size: 0.9rem;
  }

  .progress-bar {
    height: 8px;
    margin: 0.5rem auto;
  }

  .section-header {
    margin: 1.5rem 0;
    padding: 1rem;
  }

  .section-header h2 {
    font-size: 1.5rem;
    line-height: 1.2;
  }

  .section-header p {
    font-size: 1rem;
  }

  .module-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0 1rem;
  }

  .module-card {
    padding: 1.5rem;
    margin: 0;
  }

  .module-card h2 {
    font-size: 1.3rem;
    line-height: 1.3;
  }

  .module-card p {
    font-size: 1rem;
    margin-bottom: 1rem;
  }

  .module-card .objectives {
    margin-bottom: 1rem;
  }

  .module-card .objectives h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
  }

  .module-card .objectives ul {
    padding-left: 1.2rem;
  }

  .module-card .objectives li {
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
  }

  .start-btn {
    width: 100%;
    text-align: center;
    padding: 0.8rem;
    font-size: 1rem;
  }

  /* Add safe area for notched devices */
  @supports (padding: max(0px)) {
    .container {
      padding-left: max(15px, env(safe-area-inset-left));
      padding-right: max(15px, env(safe-area-inset-right));
    }
  }
}

/* Additional breakpoint for very small devices */
@media (max-width: 360px) {
  .progress-step {
    width: 25px;
    height: 25px;
    font-size: 0.8rem;
  }

  .module-card {
    padding: 1.2rem;
  }

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