/* Enhanced Base Styles */
body {
  background-color: #0b0f2b;
  color: #fdd76e;
  font-family: -apple-system, 'Palatino', 'Georgia', serif;
  padding: 20px;
  line-height: 1.6;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="20" cy="20" r="1" fill="%23fdd76e22"/><circle cx="50" cy="30" r="1.5" fill="%23fdd76e33"/><circle cx="80" cy="20" r="1" fill="%23fdd76e22"/><circle cx="30" cy="70" r="1.2" fill="%23fdd76e28"/><circle cx="70" cy="80" r="1" fill="%23fdd76e22"/></svg>');
}

/* Enhanced Typography */
h1, h2, h3 {
  color: #f9b64e;
  font-family: -apple-system, 'Apple Chancery', cursive;
  text-align: center;
  margin: 0.5em 0;
  text-shadow: 0 0 10px rgba(249, 182, 78, 0.3);
}

h1 {
  font-size: 2.5rem;
  /* background: linear-gradient(90deg, #f9b64e, #fdd76e);*/
  /* -webkit-background-clip: text; */
   background-clip: text;
  /* color: transparent; */
  padding: 10px 0;
}

h2 {
  font-size: 1.8rem;
}

h3 {
  font-size: 1.4rem;
  color: #a8d8ea;
}

/* Enhanced Layout */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

/* Enhanced Progress Dashboard */
.progress-dashboard {
  background: rgba(28, 34, 61, 0.9);
  border: 1px solid #fdd76e;
  border-radius: 16px;
  padding: 20px;
  margin: 20px auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(5px);
  position: relative;
  overflow: hidden;
}

.progress-dashboard::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(253, 215, 110, 0.05) 0%, transparent 70%);
  z-index: -1;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.progress-stats {
  font-size: 1.2rem;
  color: #a8d8ea;
  display: flex;
  align-items: center;
}

.progress-stats::before {
  content: '🌠';
  margin-right: 8px;
}

.progress-bar-container {
  height: 16px;
  background: rgba(253, 215, 110, 0.2);
  border-radius: 8px;
  margin: 15px 0;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #f9b64e, #fdd76e);
  transition: width 0.5s ease;
  position: relative;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, 
    rgba(255, 255, 255, 0) 0%, 
    rgba(255, 255, 255, 0.3) 50%, 
    rgba(255, 255, 255, 0) 100%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.domain-progress {
  margin-top: 20px;
}

.domain-progress-item {
  display: flex;
  align-items: center;
  margin: 10px 0;
  padding: 12px 0;
  border-bottom: 1px dashed rgba(253, 215, 110, 0.2);
  transition: transform 0.3s ease;
}

.domain-progress-item:hover {
  transform: translateX(5px);
}

/* Larger progress section icons */
.domain-progress-item img {
  width: 48px !important;
  height: 48px !important;
  margin-right: 15px;
  filter: drop-shadow(0 0 8px rgba(253, 215, 110, 0.7));
  cursor: pointer;
  transition: all 0.3s ease;
}

.domain-progress-item img:hover {
  transform: scale(1.1);
  filter: drop-shadow(0 0 12px rgba(253, 215, 110, 0.9));
}

/* Enhanced Controls */
.controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 25px 0;
  flex-wrap: wrap;
}

.control-btn {
  background: rgba(253, 215, 110, 0.3);
  color: #fdd76e;
  border: 1px solid #fdd76e;
  border-radius: 12px;
  padding: 12px 24px;
  cursor: pointer;
  font-family: -apple-system, 'Palatino', 'Georgia', serif;
  transition: all 0.3s ease;
  font-size: 1rem;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.control-btn::before {
  margin-right: 8px;
}
.control-btn::after {
  margin-left: 8px;
}

.control-btn:hover {
  background: rgba(253, 215, 110, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Enhanced Accordion Styles */
.domain-accordion {
  margin-bottom: 1.5rem;
  border: 1px solid rgba(253, 215, 110, 0.3);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(28, 34, 61, 0.7);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.domain-accordion:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.domain-header {
  background: linear-gradient(90deg, rgba(42, 48, 80, 0.9), rgba(42, 48, 80, 0.7));
  padding: 24px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.domain-header:hover {
  background: linear-gradient(90deg, rgba(42, 48, 80, 0.95), rgba(42, 48, 80, 0.8));
}

/* Larger domain header icons */
.domain-glyph {
  width: 72px;
  height: 72px;
  margin-right: 20px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(253, 215, 110, 0.8));
  transition: all 0.3s ease;
  cursor: pointer;
}

.domain-header:hover .domain-glyph {
  transform: rotate(10deg) scale(1.1);
}

.domain-title {
  font-size: 1.6rem;
  color: #f9b64e;
  flex-grow: 1;
  font-family: -apple-system, 'Apple Chancery', cursive;
  letter-spacing: 0.5px;
  text-shadow: 0 0 8px rgba(249, 182, 78, 0.3);
}

.domain-toggle {
  font-size: 2rem;
  color: #fdd76e;
  width: 40px;
  text-align: center;
  transition: transform 0.3s ease;
  display: flex;
  justify-content: center;
}

.domain-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.domain-content.expanded {
  max-height: 5000px;
}

.domain-content.expanded + .domain-header .domain-toggle i {
  transform: rotate(180deg);
}

/* Enhanced Milestone Cards */
.milestone-card {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(253, 215, 110, 0.1);
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(28, 34, 61, 0.5);
}

.milestone-card:hover {
  background: rgba(42, 48, 80, 0.5);
  transform: translateX(5px);
}

.milestone-card.completed {
  background: linear-gradient(90deg, rgba(76, 175, 80, 0.1), rgba(28, 34, 61, 0.7));
  border-left: 4px solid #4CAF50;
}

.milestone-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  gap: 12px;
  flex-wrap: wrap;
}

.moon-badge {
  font-size: 1.4rem;
  line-height: 1;
  color: #ffecb3;
  filter: drop-shadow(0 0 6px #ffeeb3);
  pointer-events: none;
  animation: glowPulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes glowPulse {
  0% { filter: drop-shadow(0 0 6px #ffeeb3); transform: scale(1); }
  50% { filter: drop-shadow(0 0 12px #fff2cc); transform: scale(1.1); }
  100% { filter: drop-shadow(0 0 6px #ffeeb3); transform: scale(1); }
}

.milestone-title-container {
  position: relative;
  padding-right: 2rem;
}

.milestone-title {
  font-size: 1.1rem;
  color: #f9b64e;
  margin-bottom: 8px;
  padding-top: 8px;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 10px;
  display: flex;
  align-items: center;
  font-family: -apple-system, 'Apple Chancery', cursive;
}

.milestone-glyph {
  width: 36px;
  height: 36px;
  margin-right: 12px;
  object-fit: contain;
  opacity: 0.95;
  filter: drop-shadow(0 0 5px rgba(253, 215, 110, 0.7));
}

.milestone-age {
  color: #a8d8ea;
  font-size: 0.95rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}

.milestone-age::before {
  content: '⏳';
  margin-right: 6px;
  font-size: 0.9rem;
}

.milestone-domain {
  font-size: 0.9rem;
  color: rgba(253, 215, 110, 0.9);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
}

.milestone-domain small {
  color: rgba(253, 215, 110, 0.6);
  margin-left: 10px;
  font-size: 0.85rem;
}

.milestone-description {
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(255, 246, 214, 0.95);
  padding-left: 48px;
}

/* Enhanced Completion Badge */
.moon-badge {
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 1.8rem;
  animation: moonFlash 0.8s ease;
  filter: drop-shadow(0 0 8px rgba(253, 215, 110, 0.7));
  transition: transform 0.3s ease;
}

.moon-badge:hover {
  transform: rotate(15deg) scale(1.2);
}

@keyframes moonFlash {
  0% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.2); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

/* Enhanced Constellation Background */
.constellation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  opacity: 0.2;
  overflow: hidden;
}

.star {
  position: absolute;
  background-color: #fdd76e;
  border-radius: 50%;
  animation: twinkle 4s infinite alternate;
  transition: all 0.5s ease;
}

.star::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(253, 215, 110, 0.8) 0%, transparent 70%);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.star:hover::after {
  opacity: 0.3;
}

@keyframes twinkle {
  0% { opacity: 0.3; transform: scale(0.9); }
  50% { opacity: 0.8; transform: scale(1.1); }
  100% { opacity: 0.5; transform: scale(1); }
}

/* Enhanced Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 15, 43, 0.97);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease forwards;
}

.modal-content {
  background: linear-gradient(135deg, #1c223d, #0f142f);
  border: 2px solid #fdd76e;
  border-radius: 20px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  position: relative;
  color: #fff6d6;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="10" cy="10" r="0.5" fill="%23fdd76e10"/><circle cx="30" cy="30" r="0.5" fill="%23fdd76e10"/><circle cx="70" cy="20" r="0.5" fill="%23fdd76e10"/><circle cx="90" cy="90" r="0.5" fill="%23fdd76e10"/></svg>');
  opacity: 0.1;
  z-index: -1;
}

.modal.show .modal-content {
  transform: scale(1);
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 2rem;
  cursor: pointer;
  color: #fdd76e;
  transition: transform 0.3s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close-modal:hover {
  transform: rotate(90deg) scale(1.1);
  background: rgba(253, 215, 110, 0.1);
}

.modal-title {
  color: #f9b64e;
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  text-align: center;
  font-family: -apple-system, 'Apple Chancery', cursive;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(253, 215, 110, 0.3);
}

.modal-section {
  margin-bottom: 1.5rem;
  background: rgba(28, 34, 61, 0.5);
  padding: 15px;
  border-radius: 12px;
  border-left: 3px solid #fdd76e;
}

.modal-section-title {
  color: #a8d8ea;
  font-weight: bold;
  margin-bottom: 0.8rem;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
}

.modal-section-title::before {
  content: "✦";
  margin-right: 10px;
  font-size: 1rem;
  color: #fdd76e;
}

.complete-btn {
  background: linear-gradient(90deg, rgba(253, 215, 110, 0.3), rgba(249, 182, 78, 0.3));
  color: #fdd76e;
  border: 1px solid #fdd76e;
  border-radius: 12px;
  padding: 12px 25px;
  cursor: pointer;
  margin: 2rem auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  font-family: -apple-system, 'Palatino', 'Georgia', serif;
  font-size: 1.1rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  width: 80%;
}

.complete-btn::before {
  margin-right: 10px;
}

.complete-btn::after {
  margin-left: 10px;
}

.complete-btn:hover {
  background: linear-gradient(90deg, rgba(253, 215, 110, 0.5), rgba(249, 182, 78, 0.5));
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.completed-btn {
  background: linear-gradient(90deg, rgba(76, 175, 80, 0.3), rgba(56, 142, 60, 0.3));
  border-color: #4CAF50;
  color: #fff;
}

.completed-btn::before {
  content: '✨';
}

.completed-btn::after {
  content: '✨';
}

/* Glyph Guide Modal */
.glyph-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(76, 79, 100, 0.95);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease forwards;
}

.glyph-modal.show {
  display: flex;
}

.glyph-modal-content {
  background: linear-gradient(135deg, #1c223d, #0f142f);
  border: 2px solid #fdd76e;
  border-radius: 20px;
  padding: 30px;
  max-width: 600px;
  width: 90%;
  position: relative;
  color: #fff6d6;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
  max-height: 80vh;
  overflow-y: auto;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.glyph-modal.show .glyph-modal-content {
  transform: scale(1);
}

.glyph-modal-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

.glyph-modal-icon {
  width: 100px;
  height: 100px;
  margin-right: 20px;
  filter: drop-shadow(0 0 15px rgba(253, 215, 110, 0.8));
}

.glyph-modal-title {
  font-size: 1.8rem;
  color: #f9b64e;
  font-family: -apple-system, 'Apple Chancery', cursive;
  line-height: 1.3;
}

.glyph-modal-title small {
  display: block;
  font-size: 1.4rem;
  color: #a8d8ea;
  margin-top: 5px;
}

.glyph-modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 2rem;
  cursor: pointer;
  color: #fdd76e;
  transition: transform 0.3s ease;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.glyph-modal-close:hover {
  transform: rotate(90deg) scale(1.1);
  background: rgba(253, 215, 110, 0.1);
}

/* Celebration Animation */
@keyframes celebrate {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

.celebrate {
  animation: celebrate 0.5s ease 2;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  body {
    padding: 15px;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .progress-dashboard {
    padding: 15px;
  }
  
  .domain-header {
    padding: 15px;
  }
  
  .domain-glyph {
    width: 60px;
    height: 60px;
    margin-right: 15px;
  }
  
  .domain-progress-item img {
    width: 40px !important;
    height: 40px !important;
  }
  
  .milestone-card {
    padding: 15px;
  }
  
  .modal-content, .glyph-modal-content {
    padding: 20px;
  }
  
  .glyph-modal-icon {
    width: 80px;
    height: 80px;
  }
  
  .glyph-modal-title {
    font-size: 1.5rem;
  }
  
  .glyph-modal-title small {
    font-size: 1.2rem;
  }
  
  .controls {
    flex-direction: column;
    align-items: center;
  }
  
  .control-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Animation Classes */
.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

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

.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Celebration stars */
.celebration-star {
  position: absolute;
  font-size: 1.5rem;
  animation: celebrateStar 1.5s ease-out forwards;
  pointer-events: none;
  z-index: 2001;
}

@keyframes celebrateStar {
  0% { transform: scale(0.5) translateY(0); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: scale(1.5) translateY(-100px); opacity: 0; }
}

/* Shooting stars */
@keyframes shoot {
  0% { transform: translateX(0) translateY(0); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translateX(100px) translateY(100px); opacity: 0; }
}

/* Temporary messages */
.temp-message {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  border-radius: 30px;
  font-weight: bold;
  z-index: 1001;
  opacity: 0;
  animation: fadeInUp 0.3s ease forwards;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.temp-message.success {
  background: rgba(76, 175, 80, 0.9);
  color: white;
}

.temp-message.error {
  background: rgba(244, 67, 54, 0.9);
  color: white;
}

.temp-message.info {
  background: rgba(33, 150, 243, 0.9);
  color: white;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}