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

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

body {
  background: #f5f5f5;
  color: #000;
  padding-bottom: 100px;
  min-height: 100vh;
}

a {
  color: #2563eb;
  text-decoration: none;
  font-weight: 700;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 20px;
}

/* ===== TOP BAR ===== */
.top-bar {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 20px;
  background: #f5f5f5;
  border-bottom: 2px solid #000;
  position: sticky;
  top: 0;
  z-index: 100;
}

.menu-btn {
  width: 50px;
  height: 50px;
  background: #00e599;
  border: 2px solid #000;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 3px 3px 0 #000;
  text-decoration: none;
}

.menu-btn:hover {
  background: #00cc88;
  text-decoration: none;
}

.menu-btn svg {
  width: 24px;
  height: 24px;
  stroke: #000;
  stroke-width: 3;
  fill: none;
}

.search-bar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 2px solid #000;
  border-radius: 12px;
  padding: 12px 15px;
  box-shadow: 3px 3px 0 #000;
  margin: 0;
}

.search-bar svg {
  width: 20px;
  height: 20px;
  stroke: #000;
  stroke-width: 2.5;
  fill: none;
  flex-shrink: 0;
}

.search-bar input {
  border: none;
  outline: none;
  font-size: 0.95rem;
  width: 100%;
  background: transparent;
  font-weight: 600;
}

.search-bar input::placeholder {
  color: #888;
  font-weight: 500;
}

/* ===== HERO ===== */
.hero {
  text-align: center;
  margin: 30px 0 40px;
}

.hero h1 {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 15px;
}

.hero h1 .highlight {
  display: inline-block;
  background: #00e599;
  padding: 2px 12px;
  border: 3px solid #000;
  border-radius: 12px;
  box-shadow: 3px 3px 0 #000;
}

.hero p {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 30px;
  line-height: 1.5;
}

.btn-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  border: 3px solid #000;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 4px 4px 0 #000;
  transition: transform 0.1s, box-shadow 0.1s;
  text-decoration: none;
  color: #000;
}

.btn:hover {
  text-decoration: none;
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 #000;
}

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

.btn-blue { background: #2563eb; color: #fff; }
.btn-yellow { background: #facc15; }
.btn-green { background: #00e599; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-white { background: #fff; }

.btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.5;
  fill: none;
}

.btn-blue svg, .btn-danger svg { stroke: #fff; }
.btn-yellow svg, .btn-green svg, .btn-white svg { stroke: #000; }

.btn-sm {
  padding: 8px 14px;
  font-size: 0.8rem;
  border-radius: 10px;
  box-shadow: 2px 2px 0 #000;
}

/* ===== SECTION HEADER ===== */
.section-header {
  margin-top: 40px;
  margin-bottom: 20px;
  border-top: 3px solid #000;
  padding-top: 30px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.section-title svg {
  width: 28px;
  height: 28px;
  stroke: #facc15;
  stroke-width: 3;
  fill: none;
}

.section-subtitle {
  font-size: 0.9rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 15px;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #fff;
  border: 3px solid #000;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 800;
  color: #2563eb;
  text-decoration: none;
  box-shadow: 3px 3px 0 #000;
  margin-bottom: 20px;
}

.link-btn:hover {
  text-decoration: none;
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 #000;
}

.link-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 3;
  fill: none;
}

/* ===== SNIPPET CARD ===== */
.snippet-card {
  background: #fff;
  border: 3px solid #000;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 5px 5px 0 #000;
}

.card-tags {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.tag {
  display: inline-block;
  padding: 4px 12px;
  border: 2px solid #000;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag-green { background: #00e599; }
.tag-blue { background: #2563eb; color: #fff; }
.tag-yellow { background: #facc15; }
.tag-red { background: #ef4444; color: #fff; }

.snippet-card h3 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.snippet-card h3 a {
  color: #000;
  text-decoration: none;
}

.snippet-card h3 a:hover {
  text-decoration: underline;
}

.snippet-card p {
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 15px;
  line-height: 1.5;
}

.code-preview {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 15px;
  border-radius: 10px;
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  line-height: 1.5;
  overflow-x: auto;
  margin-bottom: 15px;
  border: 2px solid #000;
  white-space: pre;
  max-height: 200px;
}

.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.card-lang {
  font-size: 0.75rem;
  font-weight: 700;
  color: #666;
}

.action-btns {
  display: flex;
  gap: 10px;
}

.action-btn {
  padding: 6px 12px;
  border: 2px solid #000;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  background: #facc15;
  box-shadow: 2px 2px 0 #000;
  transition: transform 0.1s, box-shadow 0.1s;
}

.action-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 #000;
}

.action-btn.blue {
  background: #2563eb;
  color: #fff;
}

/* ===== ABOUT GRID ===== */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.about-card {
  background: #fff;
  padding: 20px;
  border: 3px solid #000;
  border-radius: 14px;
  box-shadow: 4px 4px 0 #000;
}

.about-card h4 {
  color: #000;
  margin-bottom: 8px;
  font-weight: 800;
  font-size: 1rem;
}

.about-card p {
  font-size: 0.85rem;
  color: #555;
  font-weight: 500;
  line-height: 1.5;
}

/* ===== FORM ===== */
.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 800;
  font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px;
  background: #fff;
  border: 2px solid #000;
  border-radius: 10px;
  color: #000;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 3px 3px 0 #000;
  outline: none;
}

.form-group textarea {
  min-height: 150px;
  font-family: 'Courier New', monospace;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  background: #fffbe6;
}

/* ===== ALERT ===== */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 15px;
  font-weight: 700;
  border: 2px solid #000;
  box-shadow: 3px 3px 0 #000;
}

.alert-success {
  background: #00e599;
  color: #000;
}

.alert-error {
  background: #ef4444;
  color: #fff;
}

/* ===== MODAL ===== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: flex-start;
  z-index: 1000;
  padding: 20px;
  overflow-y: auto;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: #fff;
  border: 3px solid #000;
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  box-shadow: 6px 6px 0 #000;
  position: relative;
  overflow: hidden;
  margin: auto 0;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 15px 20px 0;
  gap: 10px;
}

.modal-header .card-tags {
  margin-bottom: 0;
  flex: 1;
}

.modal-close-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #ef4444;
  border: 3px solid #000;
  color: #fff;
  font-size: 1.3rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 3px 3px 0 #000;
  line-height: 1;
  flex-shrink: 0;
  transition: transform 0.1s;
}

.modal-close-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 #000;
}

.modal-content h2 {
  font-size: 1.5rem;
  font-weight: 800;
  padding: 15px 20px 0;
  color: #000;
}

.modal-desc {
  padding: 8px 20px 15px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #555;
  line-height: 1.5;
}

.modal-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px 15px;
  gap: 10px;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.9rem;
}

.author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  border: 2px solid #000;
}

.verified-badge {
  width: 18px;
  height: 18px;
  background: #2563eb;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  border: 2px solid #000;
}

.views-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.85rem;
  color: #555;
}

.views-info svg {
  width: 18px;
  height: 18px;
  stroke: #555;
  stroke-width: 2.5;
  fill: none;
}

/* ===== CODE WINDOW ===== */
.code-window {
  margin: 0 20px 20px;
  background: #1e1e1e;
  border: 3px solid #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 4px 4px 0 #000;
}

.code-window-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #252526;
  border-bottom: 2px solid #000;
}

.window-dots {
  display: flex;
  gap: 6px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid #000;
}

.dot.red { background: #ef4444; }
.dot.yellow { background: #facc15; }
.dot.green { background: #22c55e; }

.code-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1e1e1e;
  border: 2px solid #000;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #d4d4d4;
  flex: 1;
  overflow: hidden;
}

.js-badge {
  background: #facc15;
  color: #000;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 800;
  font-size: 0.65rem;
}

.code-tabs span:last-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.code-actions {
  display: flex;
  gap: 6px;
}

.code-action-btn {
  background: #333;
  color: #d4d4d4;
  border: 2px solid #000;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.code-action-btn.salin {
  background: #facc15;
  color: #000;
}

.code-breadcrumb {
  background: #1e1e1e;
  padding: 8px 15px;
  font-size: 0.7rem;
  color: #858585;
  font-family: 'Courier New', monospace;
  border-bottom: 1px solid #333;
}

.code-body {
  background: #1e1e1e;
  max-height: 350px;
  overflow: auto;
}

.code-body pre {
  margin: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  font-size: 0.75rem !important;
  padding: 15px !important;
}

.code-body code {
  font-family: 'Courier New', monospace !important;
  font-size: 0.75rem !important;
}

/* ===== MODAL BOTTOM BUTTONS ===== */
.modal-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 20px 20px;
}

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

.modal-btns .btn {
  flex: 1;
  padding: 12px;
  font-size: 0.9rem;
  justify-content: center;
}

.modal-btns .btn-full {
  width: 100%;
  flex: unset;
}

/* ===== LINE NUMBERS PLUGIN ===== */
pre[class*="language-"].line-numbers {
  padding-left: 3.8em !important;
  counter-reset: linenumber;
  margin: 0 !important;
}

pre[class*="language-"].line-numbers > code {
  white-space: pre;
  position: relative;
}

.line-numbers .line-numbers-rows {
  border-right: 1px solid #333 !important;
  left: -3.8em !important;
  width: 3em !important;
}

.line-numbers-rows > span:before {
  color: #858585 !important;
  padding-right: 0.8em !important;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #fff;
  border-top: 3px solid #000;
  display: flex;
  justify-content: space-around;
  padding: 12px 10px;
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #000;
  text-decoration: none;
  cursor: pointer;
}

.nav-item:hover {
  text-decoration: none;
  color: #2563eb;
}

.nav-item svg {
  width: 24px;
  height: 24px;
  stroke: #000;
  stroke-width: 2.5;
  fill: none;
}

.nav-item:hover svg {
  stroke: #2563eb;
}

/* ===== FAB ===== */
.fab {
  position: fixed;
  bottom: 85px;
  left: 20px;
  width: 65px;
  height: 65px;
  background: #facc15;
  border: 3px solid #000;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 4px 4px 0 #000;
  cursor: pointer;
  z-index: 101;
  text-decoration: none;
}

.fab:hover {
  text-decoration: none;
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 #000;
}

.fab svg {
  width: 30px;
  height: 30px;
  stroke: #000;
  stroke-width: 2.5;
  fill: none;
}

/* ===== TABLE ===== */
.table-wrap {
  overflow-x: auto;
  border: 3px solid #000;
  border-radius: 14px;
  box-shadow: 4px 4px 0 #000;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th {
  background: #00e599;
  padding: 12px;
  text-align: left;
  font-weight: 800;
  border-bottom: 2px solid #000;
  font-size: 0.85rem;
}

table td {
  padding: 12px;
  border-bottom: 1px solid #ddd;
  font-size: 0.85rem;
  font-weight: 600;
}

table tr:last-child td {
  border-bottom: none;
}

/* ===== ADMIN HEADER ===== */
.admin-header {
  background: #2563eb;
  color: #fff;
  border-bottom: 3px solid #000;
  padding: 20px;
}

.admin-header h1 {
  color: #fff;
  font-weight: 800;
}

.admin-header p {
  color: #fff;
  font-weight: 600;
  opacity: 0.9;
}

/* ===== FOOTER ===== */
footer {
  text-align: center;
  padding: 30px 20px;
  border-top: 3px solid #000;
  margin-top: 40px;
  background: #fff;
}

footer p {
  font-weight: 700;
  font-size: 0.85rem;
}

/* ===== WRAP MODE ===== */
.code-body.wrapped {
  white-space: pre-wrap !important;
  word-break: break-word !important;
  overflow-x: hidden !important;
}

.code-body.wrapped pre,
.code-body.wrapped code {
  white-space: pre-wrap !important;
  word-break: break-word !important;
}