/* Modules Page Styles */

.modules-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.modules-header {
  background: rgba(26, 26, 46, 0.95);
  border-bottom: 2px solid #4ec9b0;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #4ec9b0;
  margin: 0;
}

.nav-menu {
  display: flex;
  gap: 2rem;
}

.nav-link {
  color: #e0e0e0;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.nav-link:hover {
  background: rgba(78, 201, 176, 0.1);
  color: #4ec9b0;
}

.nav-link.active {
  background: rgba(78, 201, 176, 0.2);
  color: #4ec9b0;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-name {
  color: #e0e0e0;
  font-weight: 500;
}

.logout-btn {
  background: transparent;
  border: 1px solid #4ec9b0;
  color: #4ec9b0;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
}

.logout-btn:hover {
  background: #4ec9b0;
  color: #1a1a2e;
}

/* Main Content */
.modules-main {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem;
}

.modules-header-section {
  margin-bottom: 2rem;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  color: #e0e0e0;
  margin-bottom: 0.5rem;
}

.page-subtitle {
  font-size: 1rem;
  color: #a0a0a0;
}

/* Modules Grid */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.loading-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  color: #a0a0a0;
}

/* Module Card */
.module-card {
  background: rgba(26, 26, 46, 0.8);
  border: 2px solid rgba(78, 201, 176, 0.3);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.module-card:hover {
  border-color: #4ec9b0;
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(78, 201, 176, 0.2);
}

.module-card.unlocked {
  border-color: #4ec9b0;
}

.module-card.locked {
  opacity: 0.6;
  border-color: #4a5568;
}

.module-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.module-title-section {
  flex: 1;
}

.module-number {
  font-size: 0.875rem;
  color: #4ec9b0;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.module-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: #e0e0e0;
  margin-bottom: 0.5rem;
}

.module-status {
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.module-status.unlocked {
  background: rgba(78, 201, 176, 0.2);
  color: #4ec9b0;
  border: 1px solid #4ec9b0;
}

.module-status.locked {
  background: rgba(74, 85, 104, 0.2);
  color: #a0a0a0;
  border: 1px solid #4a5568;
}

.module-description {
  color: #a0a0a0;
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex: 1;
}

.module-stats {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(78, 201, 176, 0.1);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-label {
  font-size: 0.75rem;
  color: #a0a0a0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: #4ec9b0;
}

/* Challenges List */
.challenges-section {
  margin-top: 1rem;
}

.challenges-title {
  font-size: 0.875rem;
  color: #a0a0a0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.challenges-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.challenges-list::-webkit-scrollbar {
  width: 6px;
}

.challenges-list::-webkit-scrollbar-track {
  background: rgba(26, 26, 46, 0.5);
  border-radius: 3px;
}

.challenges-list::-webkit-scrollbar-thumb {
  background: rgba(78, 201, 176, 0.3);
  border-radius: 3px;
}

.challenges-list::-webkit-scrollbar-thumb:hover {
  background: rgba(78, 201, 176, 0.5);
}

.challenge-item {
  background: rgba(15, 52, 96, 0.5);
  border: 1px solid rgba(78, 201, 176, 0.2);
  border-radius: 8px;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.challenge-item:hover {
  background: rgba(15, 52, 96, 0.8);
  border-color: #4ec9b0;
  transform: translateX(4px);
}

.challenge-item.completed {
  border-color: rgba(78, 201, 176, 0.5);
  background: rgba(78, 201, 176, 0.1);
}

.challenge-difficulty {
  font-size: 1rem;
  flex-shrink: 0;
}

.challenge-difficulty.difficulty-1 { color: #48bb78; }
.challenge-difficulty.difficulty-2 { color: #38b2ac; }
.challenge-difficulty.difficulty-3 { color: #4299e1; }
.challenge-difficulty.difficulty-4 { color: #9f7aea; }
.challenge-difficulty.difficulty-5 { color: #ed8936; }

.challenge-info {
  flex: 1;
  min-width: 0;
}

.challenge-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #e0e0e0;
  margin-bottom: 0.25rem;
}

.challenge-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: #a0a0a0;
}

.challenge-category {
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.challenge-time {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.challenge-status {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.challenge-status.completed {
  background: #4ec9b0;
  color: #1a1a2e;
}

.challenge-status.incomplete {
  background: transparent;
  border: 2px solid #4a5568;
}

/* Action Button */
.module-action {
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  background: #4ec9b0;
  color: #1a1a2e;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  text-decoration: none;
  display: inline-block;
}

.module-action:hover {
  background: #3ba899;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(78, 201, 176, 0.3);
}

.module-action:disabled {
  background: #4a5568;
  color: #a0a0a0;
  cursor: not-allowed;
  transform: none;
}

.module-action.locked {
  background: #4a5568;
  color: #a0a0a0;
  cursor: not-allowed;
}

.module-action.locked:hover {
  background: #4a5568;
  transform: none;
  box-shadow: none;
}

/* Footer */
.modules-footer {
  background: rgba(26, 26, 46, 0.8);
  border-top: 1px solid rgba(78, 201, 176, 0.2);
  padding: 1.5rem;
  text-align: center;
  color: #a0a0a0;
  font-size: 0.875rem;
  margin-top: 3rem;
}

/* Responsive */
@media (max-width: 768px) {
  .modules-grid {
    grid-template-columns: 1fr;
  }

  .header-content {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .nav-menu {
    order: 3;
    width: 100%;
    justify-content: center;
  }
}

