/* ========== GOOGLE FONT ========== */
@import url('https://fonts.googleapis.com/css2?family=Bangers&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Bangers', cursive;
  background: #fdd835;
  background-image: 
    radial-gradient(circle, #ff6f00 2px, transparent 2px),
    radial-gradient(circle, #ff6f00 2px, transparent 2px);
  background-size: 40px 40px;
  background-position: 0 0, 20px 20px;
  min-height: 100vh;
  color: #1a1a1a;
  letter-spacing: 1px;
  display: flex;
  justify-content: center;
}

.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 30px 20px;
}

/* ========== COMIC HEADER ========== */
.comic-header {
  background: #fff;
  border: 5px solid #1a1a1a;
  border-radius: 20px;
  padding: 40px 30px;
  text-align: center;
  box-shadow: 8px 8px 0 #1a1a1a;
  margin-bottom: 40px;
  position: relative;
  overflow: hidden;
}

.comic-header::before {
  content: "💥";
  position: absolute;
  top: -15px;
  left: -15px;
  font-size: 50px;
  transform: rotate(-20deg);
}

.comic-header::after {
  content: "⚡";
  position: absolute;
  bottom: -15px;
  right: -15px;
  font-size: 50px;
  transform: rotate(20deg);
}

.comic-header h1 {
  font-size: 3.5em;
  color: #e53935;
  text-shadow: 3px 3px 0 #1a1a1a;
  margin-bottom: 15px;
  line-height: 1.2;
  text-transform: uppercase;
}

.comic-header p {
  font-size: 1.4em;
  color: #333;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.1);
}

/* ========== COMIC CARD ========== */
.comic-card {
  background: #fff;
  border: 5px solid #1a1a1a;
  border-radius: 20px;
  padding: 35px;
  box-shadow: 8px 8px 0 #1a1a1a;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-bottom: 30px;
}

.comic-card:hover {
  transform: translate(-3px, -3px);
  box-shadow: 12px 12px 0 #1a1a1a;
}

.comic-card h2 {
  font-size: 2.8em;
  color: #e53935;
  text-shadow: 2px 2px 0 #1a1a1a;
  margin-bottom: 15px;
}

.comic-card p {
  font-size: 1.3em;
  color: #444;
  margin-bottom: 25px;
}

/* ========== COMIC BUTTONS ========== */
.comic-btn {
  display: inline-block;
  font-family: 'Bangers', cursive;
  font-size: 1.5em;
  padding: 16px 35px;
  border: 4px solid #1a1a1a;
  border-radius: 50px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 5px 5px 0 #1a1a1a;
  transition: all 0.15s;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 8px;
  color: #fff;
}

.comic-btn:active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 #1a1a1a;
}

.comic-btn.red { background: #e53935; }
.comic-btn.blue { background: #1e88e5; }
.comic-btn.green { background: #43a047; }
.comic-btn.yellow { background: #f9a825; color: #1a1a1a; }

.comic-btn:hover {
  filter: brightness(1.1);
}

.comic-btn.small {
  font-size: 1.1em;
  padding: 10px 20px;
  border-radius: 30px;
}

/* ========== FEATURES GRID ========== */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 25px;
  margin: 40px 0;
}

.feature-card {
  background: #fff;
  border: 4px solid #1a1a1a;
  border-radius: 15px;
  padding: 25px;
  text-align: center;
  box-shadow: 5px 5px 0 #1a1a1a;
  transition: transform 0.2s;
}

.feature-card:hover {
  transform: scale(1.05) rotate(-2deg);
}

.feature-card .icon {
  font-size: 3em;
  margin-bottom: 10px;
}

.feature-card h3 {
  font-size: 1.3em;
  color: #e53935;
  text-shadow: 1px 1px 0 #1a1a1a;
}

/* ========== FOOTER ========== */
.comic-footer {
  text-align: center;
  margin-top: 40px;
  font-size: 1.2em;
  color: #333;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.1);
}

.comic-footer span {
  color: #e53935;
}

/* ========== BACK BUTTON ========== */
.back-btn {
  font-family: 'Bangers', cursive;
  font-size: 1.2em;
  padding: 12px 25px;
  border: 4px solid #1a1a1a;
  border-radius: 50px;
  background: #fff;
  color: #1a1a1a;
  cursor: pointer;
  box-shadow: 4px 4px 0 #1a1a1a;
  text-decoration: none;
  display: inline-block;
  margin-bottom: 25px;
  transition: all 0.15s;
  letter-spacing: 1px;
}

.back-btn:hover {
  background: #f5f5f5;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 #1a1a1a;
}

/* ========== TEST SECTION ========== */
.test-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 1.4em;
  color: #333;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.1);
}

select, input[type="text"] {
  font-family: 'Bangers', cursive;
  font-size: 1.2em;
  padding: 14px 16px;
  border: 4px solid #1a1a1a;
  border-radius: 12px;
  background: #fff;
  color: #1a1a1a;
  box-shadow: 4px 4px 0 #1a1a1a;
  letter-spacing: 1px;
  width: 100%;
}

select:focus, input[type="text"]:focus {
  outline: none;
  border-color: #e53935;
}

.url-row {
  display: flex;
  gap: 10px;
}

.url-row input {
  flex: 1;
}

/* ========== LOADING ========== */
.loading {
  text-align: center;
  padding: 30px;
  background: #fff;
  border: 4px solid #1a1a1a;
  border-radius: 15px;
  box-shadow: 5px 5px 0 #1a1a1a;
}

.spinner {
  border: 4px solid #ddd;
  border-top: 4px solid #e53935;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ========== PREVIEW ========== */
.preview {
  background: #fff;
  border: 4px solid #1a1a1a;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 5px 5px 0 #1a1a1a;
  text-align: center;
}

.preview img, .preview video {
  max-width: 100%;
  max-height: 350px;
  border-radius: 10px;
  border: 3px solid #1a1a1a;
}

.preview audio {
  width: 100%;
  margin-top: 10px;
}

/* ========== RESPONSE SECTION ========== */
#response-section {
  background: #fff;
  border: 4px solid #1a1a1a;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 5px 5px 0 #1a1a1a;
}

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

.response-header h3 {
  font-size: 1.5em;
  color: #333;
}

.badge {
  font-family: 'Bangers', cursive;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.9em;
  border: 3px solid #1a1a1a;
  box-shadow: 2px 2px 0 #1a1a1a;
}

.badge:first-child {
  background: #43a047;
  color: #fff;
}

.error-badge {
  background: #e53935 !important;
  color: #fff;
}

.badge-time {
  background: #f9a825;
  color: #1a1a1a;
  margin-left: 8px;
}

/* ========== JSON VIEWER ========== */
.json-viewer {
  background: #1a1a1a;
  color: #4caf50;
  padding: 20px;
  border-radius: 10px;
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.6;
  max-height: 500px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  border: 3px solid #333;
  width: 100%;
  text-align: left;
}

/* ========== COPY BUTTON ========== */
.btn-copy {
  font-family: 'Bangers', cursive;
  font-size: 1.1em;
  padding: 10px 20px;
  border: 3px solid #1a1a1a;
  border-radius: 30px;
  background: #f9a825;
  color: #1a1a1a;
  cursor: pointer;
  box-shadow: 3px 3px 0 #1a1a1a;
  transition: all 0.15s;
  margin-top: 15px;
  letter-spacing: 1px;
}

.btn-copy:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #1a1a1a;
}

/* ========== TOGGLE RESPONSE BUTTON ========== */
.btn-toggle-response {
  font-family: 'Bangers', cursive;
  font-size: 1em;
  padding: 8px 16px;
  border: 3px solid #1a1a1a;
  border-radius: 20px;
  background: #1e88e5;
  color: #fff;
  cursor: pointer;
  box-shadow: 3px 3px 0 #1a1a1a;
  transition: all 0.15s;
  margin-top: 12px;
  letter-spacing: 1px;
}

.btn-toggle-response:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #1a1a1a;
}

.response-preview {
  max-height: 300px;
  font-size: 11px;
  margin-top: 10px;
  text-align: left;
}

/* ========== DOCS SECTION ========== */
.docs-section {
  text-align: left;
}

.docs-section h2 {
  font-size: 2em;
  color: #e53935;
  text-shadow: 2px 2px 0 #1a1a1a;
  margin-bottom: 15px;
  text-align: center;
}

.docs-section code {
  background: #ffeb3b;
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 0.8em;
  border: 2px solid #1a1a1a;
  color: #1a1a1a;
  font-family: 'Courier New', monospace;
  display: inline-block;
  word-break: break-all;
}

/* ========== ENDPOINT CARD ========== */
.endpoint-card {
  background: #fff;
  border: 4px solid #1a1a1a;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 15px;
  box-shadow: 4px 4px 0 #1a1a1a;
  transition: transform 0.2s;
  text-align: left;
}

.endpoint-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 #1a1a1a;
}

.endpoint-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.method {
  display: inline-block;
  font-family: 'Courier New', monospace;
  padding: 5px 12px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  border: 2px solid #1a1a1a;
}

.method.get {
  background: #43a047;
  color: #fff;
}

.path {
  font-family: 'Courier New', monospace;
  color: #e53935;
  font-size: 15px;
  font-weight: bold;
  word-break: break-all;
}

.desc {
  color: #444;
  margin-top: 8px;
  font-size: 1.2em;
}

.params {
  margin-top: 6px;
  font-size: 1em;
  color: #666;
}

.note {
  font-size: 0.9em;
  color: #888;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .container {
    padding: 15px 10px;
  }

  .comic-header {
    padding: 25px 15px;
  }

  .comic-header h1 {
    font-size: 1.8em;
  }

  .comic-header p {
    font-size: 1em;
  }

  .comic-header::before,
  .comic-header::after {
    font-size: 30px;
  }

  .comic-card {
    padding: 20px 15px;
  }

  .comic-card h2 {
    font-size: 1.8em;
  }

  .comic-btn {
    font-size: 1.1em;
    padding: 12px 22px;
    margin: 5px;
    display: block;
    width: 100%;
    text-align: center;
  }

  .features {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .feature-card {
    padding: 15px 10px;
  }

  .feature-card .icon {
    font-size: 2em;
  }

  .feature-card h3 {
    font-size: 1em;
  }

  .url-row {
    flex-direction: column;
  }

  .url-row input {
    width: 100%;
  }

  .url-row .comic-btn {
    width: 100%;
  }

  .endpoint-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .path {
    font-size: 13px;
  }

  select, input[type="text"] {
    font-size: 1em;
    padding: 10px 12px;
  }

  .badge {
    font-size: 0.7em;
    padding: 4px 10px;
  }

  .response-header h3 {
    font-size: 1.2em;
  }

  .json-viewer {
    font-size: 10px;
    padding: 10px;
    max-height: 300px;
  }

  .back-btn {
    font-size: 1em;
    padding: 10px 20px;
  }
}

@media (max-width: 400px) {
  .comic-header h1 {
    font-size: 1.4em;
  }

  .features {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .feature-card {
    padding: 10px 5px;
  }

  .feature-card .icon {
    font-size: 1.5em;
  }

  .feature-card h3 {
    font-size: 0.8em;
  }

  .endpoint-card {
    padding: 12px 10px;
  }

  .desc {
    font-size: 1em;
  }
}
