
/* ===== Global ===== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 30px 16px;
  background: linear-gradient(
    135deg,
    #09090c 0%,
    #161224 50%,
    #050507 100%
  );
  background-attachment: fixed;
  color: #ffffff;
  text-align: center;
  font-family: system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell,
    "Open Sans", "Helvetica Neue", sans-serif;
}

/* ===== Images ===== */
img {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* ===== Card ===== */
.card {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  background-color: #000000;
  border: 1px solid #252331;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  text-align: left;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.card:hover {
  transform: translateY(-5px);
  border-color: #49405f;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* ===== macOS Header ===== */
.mac-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 15px;
}

.mac-header span {
  display: inline-block;
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.mac-header .red {
  background-color: #ff5f57;
}

.mac-header .yellow {
  background-color: #ffbd2e;
}

.mac-header .green {
  background-color: #28c941;
}

/* ===== Card Title ===== */
.card-title {
  margin: 0 0 10px;
  color: #e6e6ef;
  font-size: 18px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

/* ===== Card Tag ===== */
.card .card-tag {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 8px;
  border-radius: 5px;
  background-color: #0d1117;
  color: #dcdcdc;
  font-size: 10px;
}

/* ===== Preview ===== */
.card-preview {
  width: 100%;
  height: 180px;
  margin-bottom: 15px;
  overflow: hidden;
  border: 1px solid #333333;
  border-radius: 6px;
}

.card-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== Code Container ===== */
.code-container {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  min-width: 0;
  padding: 16px;
  overflow: hidden;
  border: 1px solid #292929;
  border-radius: 8px;
  background-color: #1e1e1e;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
  text-align: left;
  font-family: "Courier New", Courier, monospace;
}

/* ===== Code Block ===== */
.code-block {
  margin: 0;
  min-width: 0;
  color: #d4d4d4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: "Courier New", Courier, monospace;
  font-size: 13px;
  line-height: 1.6;
}

/* ===== Code Editor ===== */
.code-editor {
  display: block;
  width: 100%;
  height: 150px;
  padding: 15px;
  overflow: auto;
  border: 1px solid #333333;
  border-radius: 5px;
  background-color: #0d1117;
  color: #dcdcdc;
  font-family: "Courier New", Courier, monospace;
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}

.code-editor pre {
  margin: 0;
}

.code-editor pre code {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.code-editor::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.code-editor::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: #555555;
}

.code-editor::-webkit-scrollbar-track {
  background: #161616;
}

/* ===== Copy Button ===== */
.copy-btn {
  display: block;
  width: 100%;
  padding: 11px 12px;
  border: none;
  border-radius: 5px;
  background-color: #007acc;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    transform 0.1s ease;
}

.copy-btn:hover {
  background-color: #0062a3;
}

.copy-btn:active {
  transform: scale(0.99);
}

.copy-btn:focus-visible {
  outline: 2px solid #66baff;
  outline-offset: 3px;
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
  body {
    padding: 20px 12px;
  }

  .card {
    padding: 14px;
  }

  .card-preview {
    height: 160px;
  }

  .code-container {
    padding: 12px;
  }

  .code-editor {
    height: 140px;
    padding: 10px;
    font-size: 12px;
  }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  .card,
  .copy-btn {
    transition: none;
  }

  .card:hover {
    transform: none;
  }
}
