
/* 🌌 Cosmic Dark Mode Glyphboard Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap');

:root {
  --cosmic-bg: #0a0a0f;
  --cosmic-bg-light: #1a1a2e;
  --cosmic-purple: #6a4c93;
  --cosmic-blue: #2d4a8a;
  --cosmic-glow: #9d84ff;
  --cosmic-text: #e0e0ff;
  --cosmic-text-dim: #a0a0c0;
  --cosmic-border: #3a3a5a;
  --cosmic-accent: #ff6b9d;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 20px;
  background: var(--cosmic-bg);
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(106, 76, 147, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(45, 74, 138, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(157, 132, 255, 0.1) 0%, transparent 50%);
  color: var(--cosmic-text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ✨ Starfield Background Animation */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 130px 80px, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(2px 2px at 160px 30px, rgba(255, 255, 255, 0.2), transparent);
  background-repeat: repeat;
  background-size: 200px 100px;
  animation: starfield 20s linear infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes starfield {
  0% { transform: translateY(0); }
  100% { transform: translateY(-100px); }
}

/* 🌟 Site Header */
.site-header {
  text-align: center;
  margin-bottom: 40px;
  padding: 30px 20px;
  background: rgba(26, 26, 46, 0.6);
  border-radius: 20px;
  border: 1px solid var(--cosmic-border);
  backdrop-filter: blur(10px);
}

.site-header h1 {
  font-size: 3rem;
  font-weight: 600;
  margin: 0 0 10px 0;
  background: linear-gradient(45deg, var(--cosmic-glow), var(--cosmic-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 20px rgba(157, 132, 255, 0.5);
}

.tagline {
  font-size: 1.2rem;
  color: var(--cosmic-text-dim);
  margin: 0 0 25px 0;
  font-weight: 300;
}

.about-section {
  max-width: 600px;
  margin: 0 auto 25px auto;
  padding: 0 20px;
}

.about-section p {
  line-height: 1.6;
  color: var(--cosmic-text);
  font-size: 1rem;
}

.feedback-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.feedback-prompt {
  color: var(--cosmic-text-dim);
  font-size: 0.9rem;
}

.feedback-btn {
  padding: 10px 20px;
  background: linear-gradient(45deg, var(--cosmic-purple), var(--cosmic-blue));
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(106, 76, 147, 0.3);
}

.feedback-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(106, 76, 147, 0.5);
  background: linear-gradient(45deg, var(--cosmic-glow), var(--cosmic-accent));
}

/* 📖 Instructions */
.instructions {
  text-align: center;
  margin-bottom: 20px;
  color: var(--cosmic-text-dim);
}

/* 🎹 Block Display */
#blockDisplay {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--cosmic-glow);
  text-shadow: 0 0 10px rgba(157, 132, 255, 0.4);
}

/* 🎛️ Glyph Panel */
#glyphPanel {
  margin-bottom: 30px;
  padding: 25px;
  background: rgba(26, 26, 46, 0.4);
  border-radius: 15px;
  border: 1px solid var(--cosmic-border);
  backdrop-filter: blur(5px);
}

.glyph-row {
  display: flex;
  justify-content: center;
  margin-bottom: 15px;
  gap: 8px;
  flex-wrap: wrap;
}

.glyph {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border: 1px solid var(--cosmic-border);
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
  transition: all 0.3s ease;
  background: rgba(10, 10, 15, 0.6);
  position: relative;
  overflow: hidden;
}

.glyph::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle, rgba(157, 132, 255, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.glyph:hover::before {
  opacity: 1;
}

.glyph:hover {
  border-color: var(--cosmic-glow);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(157, 132, 255, 0.3);
}

.glyph:active {
  transform: translateY(-1px) scale(0.95);
  animation: glyphPulse 0.3s ease-out;
}

@keyframes glyphPulse {
  0% { box-shadow: 0 0 0 0 rgba(157, 132, 255, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(157, 132, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(157, 132, 255, 0); }
}

.glyph div {
  font-size: 24px;
  color: var(--cosmic-text);
  text-shadow: 0 0 8px rgba(157, 132, 255, 0.4);
}

.glyph small {
  font-size: 10px;
  color: var(--cosmic-text-dim);
  margin-top: 2px;
}

.glyph.is-favorite {
  border-color: var(--cosmic-accent);
  background: rgba(255, 107, 157, 0.1);
}

.glyph.is-favorite::before {
  background: radial-gradient(circle, rgba(255, 107, 157, 0.2) 0%, transparent 70%);
  opacity: 1;
}

/* ⭐ Favorites Section */
.favorites-section {
  margin-bottom: 25px;
  padding: 20px;
  background: rgba(255, 107, 157, 0.05);
  border-radius: 12px;
  border: 1px solid rgba(255, 107, 157, 0.2);
}

.favorites-title {
  text-align: center;
  color: var(--cosmic-accent);
  margin: 0 0 15px 0;
  font-size: 1.2rem;
  text-shadow: 0 0 10px rgba(255, 107, 157, 0.4);
}

.favorite-glyph {
  border: 2px dashed var(--cosmic-accent) !important;
  background: rgba(255, 107, 157, 0.1);
}

/* 📝 Editor */
#editor {
  width: 100%;
  min-height: 150px;
  padding: 20px;
  border: 1px solid var(--cosmic-border);
  border-radius: 12px;
  font-size: 18px;
  line-height: 1.6;
  resize: vertical;
  background: rgba(10, 10, 15, 0.8);
  color: var(--cosmic-text);
  backdrop-filter: blur(5px);
  margin-bottom: 30px;
}

#editor::placeholder {
  color: var(--cosmic-text-dim);
  font-style: italic;
}

#editor:focus {
  outline: none;
  border-color: var(--cosmic-glow);
  box-shadow: 0 0 20px rgba(157, 132, 255, 0.3);
}

/* 🌀 Circular Composer */
#circularComposer {
  margin: 30px 0;
  padding: 30px;
  background: rgba(26, 26, 46, 0.4);
  border-radius: 20px;
  border: 1px solid var(--cosmic-border);
  text-align: center;
  backdrop-filter: blur(10px);
}

#circularComposer h3 {
  margin: 0 0 20px 0;
  color: var(--cosmic-glow);
  font-size: 1.8rem;
  text-shadow: 0 0 15px rgba(157, 132, 255, 0.5);
}

#glyphCanvas {
  border: 2px solid var(--cosmic-border);
  border-radius: 50%;
  cursor: crosshair;
  background: radial-gradient(circle, rgba(10, 10, 15, 0.9) 0%, rgba(26, 26, 46, 0.6) 100%);
  box-shadow: 
    0 0 30px rgba(157, 132, 255, 0.2),
    inset 0 0 30px rgba(10, 10, 15, 0.5);
  transition: all 0.3s ease;
}

#glyphCanvas:hover {
  border-color: var(--cosmic-glow);
  box-shadow: 
    0 0 40px rgba(157, 132, 255, 0.4),
    inset 0 0 30px rgba(10, 10, 15, 0.5);
}

.composer-controls {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.composer-controls button {
  padding: 12px 24px;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

#clearCanvas {
  background: linear-gradient(45deg, #ff6b6b, #ee5a52);
  color: white;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

#exportComposition {
  background: linear-gradient(45deg, #4ecdc4, #44a08d);
  color: white;
  box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

.composer-controls button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.composer-controls button:active {
  transform: translateY(0);
}

/* 📖 Composer Instructions */
.composer-instructions {
  margin-top: 25px;
  padding: 20px;
  background: rgba(10, 10, 15, 0.4);
  border-radius: 12px;
  border: 1px solid var(--cosmic-border);
  text-align: left;
}

.composer-instructions h4 {
  margin: 0 0 15px 0;
  color: var(--cosmic-glow);
  text-align: center;
  font-size: 1.1rem;
}

.instruction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 15px;
}

.instruction-item {
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  color: var(--cosmic-text);
  padding: 8px;
  background: rgba(26, 26, 46, 0.3);
  border-radius: 8px;
}

.instruction-item strong {
  color: var(--cosmic-accent);
  margin-right: 8px;
  font-weight: 600;
}

.usage-tip {
  font-size: 0.9rem;
  color: var(--cosmic-text-dim);
  line-height: 1.5;
  margin: 0;
  padding: 15px;
  background: rgba(157, 132, 255, 0.05);
  border-radius: 8px;
  border-left: 3px solid var(--cosmic-glow);
}

/* 🌟 Footer */
.site-footer {
  text-align: center;
  margin-top: 50px;
  padding: 20px;
  color: var(--cosmic-text-dim);
  font-size: 0.9rem;
  border-top: 1px solid var(--cosmic-border);
}

/* 📱 Responsive Design */
@media (max-width: 768px) {
  body {
    padding: 15px;
  }

  .site-header h1 {
    font-size: 2.2rem;
  }

  .tagline {
    font-size: 1rem;
  }

  .glyph {
    width: 50px;
    height: 50px;
  }

  .glyph div {
    font-size: 20px;
  }

  #glyphCanvas {
    width: 320px;
    height: 320px;
  }

  .composer-controls {
    flex-direction: column;
    align-items: center;
  }

  .feedback-section {
    flex-direction: column;
    gap: 10px;
  }
}

/* ✨ Animation Classes */
.pulse {
  animation: pulse 0.6s ease-out;
}

.resonantPulse {
  animation: resonantPulse 0.6s ease-out;
}

@keyframes pulse {
  0% { 
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(157, 132, 255, 0.4);
  }
  50% { 
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(157, 132, 255, 0);
  }
  100% { 
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(157, 132, 255, 0);
  }
}

@keyframes resonantPulse {
  0% { 
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 107, 157, 0.4);
  }
  25% { 
    transform: scale(1.08);
    box-shadow: 0 0 0 5px rgba(255, 107, 157, 0.2);
  }
  50% { 
    transform: scale(1.05);
    box-shadow: 0 0 0 15px rgba(157, 132, 255, 0);
  }
  100% { 
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(157, 132, 255, 0);
  }
}
