/* =====================================================
   ACHIEVEMENT SYSTEM STYLES
   ===================================================== */

/* =====================================================
   ACHIEVEMENT NOTIFICATION
   ===================================================== */
.achievement-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  transform: translateX(120%);
  transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.achievement-notification.show {
  transform: translateX(0);
}

.achievement-notification-content {
  display: flex;
  align-items: center;
  gap: 15px;
  background: linear-gradient(135deg, #1a1f36 0%, #0f1419 100%);
  border: 2px solid;
  border-radius: 12px;
  padding: 15px 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5),
              0 0 30px rgba(200, 170, 110, 0.2);
  min-width: 320px;
  max-width: 400px;
  animation: achievementGlow 2s ease-in-out infinite;
}

@keyframes achievementGlow {
  0%, 100% { box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(200, 170, 110, 0.2); }
  50% { box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 50px rgba(200, 170, 110, 0.4); }
}

.achievement-notification-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  animation: iconPulse 1s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.achievement-notification-icon i {
  font-size: 24px;
  color: white;
}

.achievement-notification-info {
  flex: 1;
}

.achievement-notification-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #C8AA6E;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.achievement-notification-title {
  font-size: 16px;
  font-weight: 700;
  color: #F0E6D2;
  margin-bottom: 4px;
}

.achievement-notification-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 6px;
}

.achievement-notification-rarity {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* =====================================================
   ACHIEVEMENTS MODAL
   ===================================================== */
.achievements-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow-y: auto;
}

.achievements-modal-content {
  background: linear-gradient(135deg, #1a1f36 0%, #0f1419 100%);
  border-radius: 16px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.achievements-modal-header {
  padding: 20px 25px;
  background: linear-gradient(135deg, rgba(200, 170, 110, 0.1), rgba(200, 170, 110, 0.05));
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.achievements-modal-title {
  font-size: 24px;
  font-weight: 700;
  color: #F0E6D2;
  display: flex;
  align-items: center;
  gap: 10px;
}

.achievements-modal-title i {
  color: #C8AA6E;
}

.achievements-modal-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 24px;
  cursor: pointer;
  padding: 5px;
  transition: color 0.3s;
}

.achievements-modal-close:hover {
  color: #F0E6D2;
}

/* Progress Bar */
.achievements-progress {
  padding: 15px 25px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.achievements-progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.achievements-progress-text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
}

.achievements-progress-points {
  font-size: 14px;
  color: #C8AA6E;
  font-weight: 600;
}

.achievements-progress-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.achievements-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #C8AA6E, rgba(200, 170, 110, 0.8));
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* Category Tabs */
.achievements-categories {
  display: flex;
  overflow-x: auto;
  padding: 15px 25px;
  gap: 10px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  scrollbar-width: thin;
  scrollbar-color: rgba(200, 170, 110, 0.5) transparent;
  min-height: 58px;
}

.achievements-categories::-webkit-scrollbar {
  height: 4px;
}

.achievements-categories::-webkit-scrollbar-track {
  background: transparent;
}

.achievements-categories::-webkit-scrollbar-thumb {
  background: rgba(200, 170, 110, 0.4);
  border-radius: 2px;
}

.achievements-categories::-webkit-scrollbar-thumb:hover {
  background: rgba(200, 170, 110, 0.6);
}

.achievement-category-tab {
  flex-shrink: 0;
  padding: 10px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  box-sizing: border-box;
}

.achievement-category-tab:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #F0E6D2;
}

.achievement-category-tab.active {
  background: linear-gradient(135deg, rgba(200, 170, 110, 0.3), rgba(200, 170, 110, 0.2));
  border: 2px solid #C8AA6E;
  color: #F0E6D2;
}

.achievement-category-tab i {
  font-size: 14px;
}

.achievement-category-count {
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 10px;
}

.achievement-category-tab.active .achievement-category-count {
  background: rgba(0, 0, 0, 0.3);
}

/* Achievements Grid */
.achievements-body {
  padding: 20px 25px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: #C8AA6E rgba(255, 255, 255, 0.1);
}

/* Custom Scrollbar for achievements body */
.achievements-body::-webkit-scrollbar {
  width: 8px;
}

.achievements-body::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.achievements-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #C8AA6E, rgba(200, 170, 110, 0.6));
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.achievements-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #d4b87a, #C8AA6E);
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
}

/* Achievement Card */
.achievement-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 15px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.achievement-card:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
}

.achievement-card.locked {
  opacity: 0.5;
}

.achievement-card.locked .achievement-card-icon {
  filter: grayscale(1);
}

.achievement-card.unlocked {
  border-color: rgba(200, 170, 110, 0.3);
}

.achievement-card.unlocked::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--rarity-color, #C8AA6E), transparent);
}

.achievement-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.achievement-card-icon {
  width: 45px;
  height: 45px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--rarity-color, #9E9E9E);
}

.achievement-card-icon i {
  font-size: 22px;
  color: white;
}

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

.achievement-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #F0E6D2;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.achievement-card-rarity {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--rarity-color, #9E9E9E);
  font-weight: 600;
}

.achievement-card-description {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.4;
  margin-bottom: 10px;
}

.achievement-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.achievement-card-points {
  font-size: 12px;
  color: #C8AA6E;
  font-weight: 600;
}

.achievement-card-status {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 10px;
}

.achievement-card-status.unlocked {
  background: rgba(76, 175, 80, 0.2);
  color: #4CAF50;
}

.achievement-card-status.locked {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.4);
}

.achievement-card-date {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 8px;
}

/* Lock Icon for locked achievements */
.achievement-card.locked .achievement-card-icon::after {
  content: '\eb57'; /* Tabler lock icon */
  font-family: 'tabler-icons';
  position: absolute;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.8);
}

/* =====================================================
   HEADER ACHIEVEMENTS BUTTON
   ===================================================== */
.achievements-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: linear-gradient(135deg, rgba(200, 170, 110, 0.2), rgba(200, 170, 110, 0.1));
  border: 1px solid rgba(200, 170, 110, 0.3);
  border-radius: 8px;
  color: #C8AA6E;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.achievements-btn:hover {
  background: linear-gradient(135deg, rgba(200, 170, 110, 0.3), rgba(200, 170, 110, 0.2));
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(200, 170, 110, 0.3);
}

.achievements-btn i {
  font-size: 16px;
}

.achievements-btn-count {
  background: rgba(200, 170, 110, 0.2);
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 11px;
}

/* =====================================================
   SIDEBAR ACHIEVEMENTS ITEM
   ===================================================== */
.sidebar-achievements-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  background: rgba(200, 170, 110, 0.05);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}

.sidebar-achievements-item:hover {
  background: rgba(200, 170, 110, 0.1);
}

.sidebar-achievements-icon {
  width: 35px;
  height: 35px;
  border-radius: 8px;
  background: linear-gradient(135deg, #C8AA6E, rgba(200, 170, 110, 0.8));
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-achievements-icon i {
  font-size: 18px;
  color: #0f1419;
}

.sidebar-achievements-info {
  flex: 1;
}

.sidebar-achievements-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.sidebar-achievements-value {
  font-size: 14px;
  font-weight: 600;
  color: #F0E6D2;
}

/* =====================================================
   RARITY COLORS (CSS Variables)
   ===================================================== */
.rarity-common { --rarity-color: #9E9E9E; }
.rarity-uncommon { --rarity-color: #4CAF50; }
.rarity-rare { --rarity-color: #2196F3; }
.rarity-epic { --rarity-color: #9C27B0; }
.rarity-legendary { --rarity-color: #C8AA6E; }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
  .achievement-notification {
    top: auto;
    bottom: 20px;
    right: 10px;
    left: 10px;
  }

  .achievement-notification-content {
    min-width: auto;
    max-width: none;
  }

  .achievements-modal-content {
    max-height: 85vh;
    margin: auto;
  }

  .achievements-grid {
    grid-template-columns: 1fr;
  }

  .achievements-categories {
    padding: 12px 15px;
    min-height: 52px;
  }

  .achievements-body {
    padding: 15px;
  }

  .achievements-modal-header {
    padding: 15px;
  }

  .achievements-modal-title {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .achievement-notification-content {
    padding: 12px 15px;
    gap: 10px;
  }

  .achievement-notification-icon {
    width: 40px;
    height: 40px;
  }

  .achievement-notification-icon i {
    font-size: 20px;
  }

  .achievement-notification-title {
    font-size: 14px;
  }

  .achievement-notification-desc {
    font-size: 11px;
  }
}

/* =====================================================
   ANIMATIONS
   ===================================================== */
@keyframes achievementUnlock {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.achievement-card.just-unlocked {
  animation: achievementUnlock 0.5s ease-out;
}

/* Shimmer effect for legendary achievements */
.achievement-card.rarity-legendary.unlocked::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(200, 170, 110, 0.1),
    transparent
  );
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* =====================================================
   EMPTY STATE
   ===================================================== */
.achievements-empty {
  text-align: center;
  padding: 40px 20px;
  color: rgba(255, 255, 255, 0.5);
}

.achievements-empty i {
  font-size: 48px;
  margin-bottom: 15px;
  opacity: 0.3;
}

.achievements-empty p {
  font-size: 14px;
}
