@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap");

@font-face {
  font-family: "GraviticaMono";
  src: url("/static/GraviticaMono.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
}

:root {
  --bg: #121212;
  --fg: #e0e0e0;
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.15);
  --accent: #bb86fc;
  --accent-2: #03dac6;
  --shadow: rgba(0, 0, 0, 0.7);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Inter", sans-serif;
  color: var(--fg);
}

body {
  background: var(--bg);
  padding: 1rem;
  line-height: 1.5;
  min-height: 100vh;
}

.container {
  width: 90%;
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
  box-sizing: border-box;
}

header {
  display: flex;
  flex-direction: column;
  gap: 1em;
  margin-bottom: 1em;
  align-items: flex-start;
}

h1, h2 {
  font-weight: 600;
  letter-spacing: 0.5px;
  font-size: clamp(1.5rem, 5vw, 2rem);
}

h1 {
  margin: 0;
}

a {
  text-decoration: none;
  color: inherit;
}

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  padding: 0.8rem;
  margin-bottom: 1rem;
  font-size: clamp(0.9rem, 3vw, 1rem);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: var(--fg);
}

input::placeholder,
textarea::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

button {
  display: inline-block;
  padding: 0.8rem;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  position: relative;
  overflow: hidden;
  width: 100%;
  font-size: clamp(0.9rem, 3vw, 1rem);
}

button::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.2);
  transform: skewX(-20deg);
  transition: left 0.5s;
}

button:hover::after {
  left: 200%;
}

button:hover {
  background: var(--accent-2);
}

.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  box-shadow: 0 8px 32px var(--shadow);
  padding: 1.5rem;
  margin-bottom: 2rem;
  width: 100%;
}

pre {
  background: #0d1117;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  font-family: "GraviticaMono", monospace;
  font-size: 0.95rem;
  white-space: pre-wrap;
}

.code-textbox {
  position: relative;
  margin: 0;
  padding: 0;
  font-family: "GraviticaMono", monospace;
  font-size: 1rem;
  background-color: #0d1117;
  border: 1px solid #ccc;
  border-radius: 4px;
  overflow: auto;
  max-height: 300px;
  line-height: 1.2;
}

.code-textbox code {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 1em;
  box-sizing: border-box;
  white-space: pre;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

.hljs-ln-numbers {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  text-align: center;
  color: #cccccc;
  border-right: 1px solid #CCC;
  vertical-align: top;
  padding-right: 5px;
}

.form-options {
  margin: 15px 0;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.option-group {
  width: 100%;
}

.option-group label {
  display: block;
  margin-bottom: 5px;
  font-size: clamp(0.8rem, 3vw, 0.9rem);
}

.option-group input[type="password"],
.option-group select {
  width: 100%;
  padding: 0.8rem;
  font-size: clamp(0.9rem, 3vw, 1rem);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg);
}

.option-group select option {
  background-color: var(--bg);
  color: var(--fg);
  padding: 0.5rem;
}

.checkbox-group {
  display: flex;
  align-items: center;
  height: 100%;
  padding-bottom: 5px;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 1rem;
  color: var(--fg);
  gap: 8px;
}

.checkbox-group input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.checkbox-group input[type="checkbox"]:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.checkbox-group input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-group input[type="checkbox"]:checked::after {
  content: "✓";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--bg);
  font-size: 12px;
  font-weight: bold;
}

.error-card {
  text-align: center;
  padding: 2rem;
}

.error-code {
  font-size: clamp(3rem, 15vw, 6rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 1.5rem;
}

.error-card h2 {
  margin-bottom: 1rem;
  color: var(--accent-2);
  font-size: clamp(1.2rem, 4vw, 1.8rem);
}

.error-card p {
  margin-bottom: 2rem;
  color: rgba(255, 255, 255, 0.8);
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  font-size: clamp(0.9rem, 3vw, 1.1rem);
}

.home-button {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  background: var(--accent);
  color: var(--bg);
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.2s ease;
  font-size: clamp(0.9rem, 3vw, 1rem);
}

.home-button:hover {
  background: var(--accent-2);
}

#codeEditor, #viewerContainer {
  width: 100%;
  height: clamp(250px, 50vh, 500px);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 1rem;
  overflow: hidden;
}

.language-display {
  position: absolute;
  right: 15px;
  top: 10px;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: clamp(0.7rem, 2.5vw, 0.8rem);
  color: var(--accent);
  z-index: 10;
}

.copy-button {
  border: none;
  background: var(--accent);
  color: var(--bg);
  padding: 0.6rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: clamp(0.8rem, 3vw, 0.9rem);
  transition: background 0.2s ease;
  width: 100%;
}

.copy-button:hover {
  background: var(--accent-2);
}

.burn-warning {
  background: rgba(255, 107, 107, 0.2);
  border-left: 4px solid #ff6b6b;
  padding: 0.8rem;
  margin-bottom: 1.5rem;
  border-radius: 0 4px 4px 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: clamp(0.9rem, 3vw, 1rem);
}

.burn-warning svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.burn-warning p {
  margin: 0;
  color: #ff6b6b;
}

.view-confirmation {
  text-align: center;
  padding: 1.5rem;
}

.view-confirmation p {
  margin-bottom: 1rem;
  font-size: clamp(0.9rem, 3vw, 1rem);
}

.view-button {
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 0.8rem;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s ease;
  margin-top: 1rem;
  width: 100%;
  font-size: clamp(0.9rem, 3vw, 1rem);
}

.error-message {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
  padding: 0.8rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 107, 107, 0.3);
  font-size: clamp(0.9rem, 3vw, 1rem);
}

.password-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.button-container {
  margin-top: 1.5rem;
  width: 100%;
}

.snippet-id {
  font-size: 0.9rem;
  color: #888;
}

.hidden {
  display: none;
}

@media (min-width: 480px) {
  button, .view-button, .copy-button {
    width: auto;
    padding: 0.8rem 1.5rem;
  }
}

@media (min-width: 768px) {
  header {
    flex-direction: row;
    align-items: center;
  }
  
  .form-options {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .option-group {
    width: calc(50% - 8px);
  }
  
  .checkbox-group {
    width: 100%;
  }
  
  body {
    padding: 2rem;
  }
  
  .glass-card {
    padding: 2rem;
  }
}