/* ===========================
   OWN CODE - Dark Developer Theme
   =========================== */

:root {
  --bg: #0f111a;
  --card-bg: #1a1b26;
  --accent: #00BCD4;
  --accent-hover: #00E5FF;
  --text-main: #eaeaea;
  --text-sub: #8b8b8b;
  --font-body: 'Inter', sans-serif;
  --font-code: 'Fira Code', monospace;
}

/* ====== Global Styles ====== */
body {
  background: var(--bg);
  color: var(--text-main);
  font-family: var(--font-body);
  margin: 0;
  padding: 0;
}

/* ====== Navbar ====== */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 40px;
  background: #13151f;
  border-bottom: 1px solid #222;
  position: sticky;
  top: 0;
  z-index: 10;
}

nav .logo {
  font-weight: 600;
  color: var(--accent);
  font-size: 1.2rem;
}

nav .tagline {
  color: var(--text-sub);
  font-size: 0.9rem;
}

/* ====== Header ====== */
header {
  text-align: center;
  padding: 80px 20px 40px;
}

header h1 {
  font-size: 2.4rem;
  margin-bottom: 10px;
}

header h1 span {
  color: var(--accent);
}

header p {
  color: var(--text-sub);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ====== Snippet Grid Layout ====== */
#snippets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 30px;
  padding: 40px 60px;
  justify-items: stretch;
  align-items: stretch;
}

/* ====== Snippet Card ====== */
.snippet-card {
  background: var(--card-bg);
  border: 1px solid #2f334d;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  min-height: 350px;
  max-width: 600px;
  position: relative;
}

.snippet-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.6);
}

/* ====== Header ====== */
.snippet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.snippet-header h3 {
  color: var(--accent);
  font-size: 1.1rem;
  margin: 0;
  font-weight: 600;
  text-shadow: 0 0 4px rgba(0, 188, 212, 0.3);
}

/* ====== Copy Button ====== */
.copy-btn {
  background: var(--accent);
  color: #000;
  border: none;
  padding: 7px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: 0.2s;
  box-shadow: 0 0 6px rgba(0, 188, 212, 0.4);
}

.copy-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.6);
}

/* ====== Copied Message ====== */
.copied {
  position: absolute;
  top: 16px;
  right: 100px;
  background: #4caf50;
  color: #fff;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.3s;
}

.copied.show {
  opacity: 1;
}

/* ====== Code Block ====== */
pre {
  background: #0e0f16;
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  overflow-y: auto;
  font-family: var(--font-code);
  font-size: 0.95rem;
  color: #e0e0e0;
  line-height: 1.6;
  white-space: pre;
  border: 1px solid #2a2e3f;
  flex-grow: 1;
  max-height: 240px;
}

/* ====== Scrollbar ====== */
pre::-webkit-scrollbar {
  height: 8px;
}
pre::-webkit-scrollbar-track {
  background: #1a1b26;
}
pre::-webkit-scrollbar-thumb {
  background-color: var(--accent);
  border-radius: 10px;
}

/* ====== Footer ====== */
footer {
  text-align: center;
  color: var(--text-sub);
  padding: 40px 20px;
  border-top: 1px solid #222;
  margin-top: 40px;
}

footer a {
  color: var(--accent);
  text-decoration: none;
}
footer a:hover {
  text-decoration: underline;
}

/* ====== Responsive Fix ====== */
@media (max-width: 768px) {
  #snippets {
    padding: 20px;
    grid-template-columns: 1fr;
  }

  .snippet-card {
    min-height: auto;
    max-width: 100%;
  }

  header {
    padding: 60px 20px 20px;
  }

  header h1 {
    font-size: 2rem;
  }
}
