/* ====== BADGE PAGE KAWAII STYLING ====== */
/* Inherits main theme variables from styles.css */

.badge-page {
  min-height: 100vh;
  background: var(--gradient-bg);
  background-attachment: fixed;
}

.badge-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 35px;
  position: relative;
}

/* Header matching main site */
.badge-header {
  height: 120px;
  background:
    linear-gradient(135deg, rgba(189, 227, 255, 0.9), rgba(255, 209, 236, 0.9)),
    url("../assets/pt_top.png");
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
}

.badge-header-content h1 {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--ink);
  text-shadow: 2px 2px 0 rgba(255, 255, 255, 0.8);
  margin: 0;
  animation: pulse 3s ease-in-out infinite;
}

.badge-header-content p {
  font-size: 1rem;
  color: var(--ink-soft);
  margin: 5px 0 0 0;
  font-style: italic;
}

.back-link {
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid var(--border);
  border-radius: 15px;
  padding: 10px 20px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  transition: all 0.3s ease;
  backdrop-filter: blur(1px);
}

.back-link:hover {
  background: var(--pastel-mint);
  transform: translateY(-2px);
  box-shadow: 0 4px 0 rgba(43, 43, 68, 0.15);
}

/* Main content area */
.badge-main {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(1px);
  border: 2px solid var(--border);
  border-top: none;
  border-radius: 0 0 20px 20px;
  padding: 30px;
  box-shadow: var(--shadow);
}

.intro-text {
  text-align: center;
  margin-bottom: 40px;
  font-size: 1.1rem;
  color: var(--ink-soft);
}

/* Badge grid */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
}

.badge-widget {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 25px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.badge-widget:hover {
  transform: translateY(-3px);
  box-shadow:
    0 6px 0 rgba(43, 43, 68, 0.15),
    0 16px 40px rgba(43, 43, 68, 0.12);
}

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

.widget-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--ink);
  margin: 0;
}

.size-badge {
  background: var(--pastel-purple);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
}

/* Preview area */
.preview-area {
  background: rgba(0, 0, 0, 0.03);
  border: 2px solid var(--border);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-area img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(43, 43, 68, 0.15);
  transition: transform 0.3s ease;
}

.preview-area img:hover {
  transform: scale(1.05);
}

.tiny-preview img {
  width: 88px;
  height: 31px;
  object-fit: cover;
  object-position: center;
  image-rendering: -webkit-optimize-contrast;
}

/* Code sections */
.code-section {
  margin-bottom: 20px;
}

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

.code-label {
  font-weight: 700;
  color: var(--ink);
  font-size: 1rem;
}

.copy-btn {
  background: var(--accent);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 8px 16px;
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 0 rgba(43, 43, 68, 0.15);
}

.copy-btn:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
  box-shadow: 0 3px 0 rgba(43, 43, 68, 0.2);
}

.copy-btn.copied {
  background: var(--pastel-mint);
  color: var(--ink);
}

.code-textarea {
  width: 100%;
  min-height: 100px;
  resize: vertical;
  font-family: "Courier New", "Monaco", monospace;
  font-size: 0.9rem;
  padding: 15px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  transition: border-color 0.3s ease;
}

.code-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(107, 195, 255, 0.2);
}

/* Special styling for our own badge */
.our-badge {
  background: linear-gradient(135deg, var(--pastel-blue), var(--pastel-pink));
  border: 1px solid var(--accent);
  position: relative;
  overflow: hidden;
}

.our-badge::before {
  content: "✨";
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 1.5rem;
  animation: sparkle 2s ease-in-out infinite;
}

/* Tips section */
.tips-section {
  background: var(--pastel-yellow);
  border: 2px solid var(--border);
  border-radius: 15px;
  padding: 20px;
  margin-top: 30px;
  text-align: center;
}

.tips-section h3 {
  color: var(--ink);
  margin-top: 0;
  font-weight: 800;
}

.tips-section p {
  color: var(--ink-soft);
  margin-bottom: 0;
}

/* Embed section */
.embed-section {
  margin: 50px 0;
  padding: 30px 0;
  border-top: 3px solid var(--border);
  border-bottom: 3px solid var(--border);
  background: linear-gradient(
    135deg,
    rgba(189, 227, 255, 0.1),
    rgba(255, 209, 236, 0.1)
  );
}

.embed-section h2 {
  position: relative;
}

.embed-section h2::before,
.embed-section h2::after {
  content: "✨";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  animation: sparkle 2s ease-in-out infinite;
}

.embed-section h2::before {
  left: -40px;
}

.embed-section h2::after {
  right: -40px;
  animation-delay: 1s;
}

/* Footer */
.badge-footer {
  text-align: center;
  padding: 20px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* Responsive design */
@media (max-width: 768px) {
  .badge-container {
    padding: 20px;
  }

  .badge-header {
    flex-direction: column;
    height: auto;
    padding: 20px;
    text-align: center;
    gap: 15px;
  }

  .badge-header-content h1 {
    font-size: 1.8rem;
  }

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

  .widget-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* Animations */
@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

@keyframes sparkle {
  0%,
  100% {
    opacity: 1;
    transform: rotate(0deg);
  }
  50% {
    opacity: 0.7;
    transform: rotate(180deg);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Kawaii elements */
.kawaii-decoration {
  font-size: 1.2rem;
  margin: 0 5px;
  animation: float 3s ease-in-out infinite;
}

.kawaii-decoration:nth-child(2n) {
  animation-delay: 1s;
}
