/* Reset & Base */
:root {
  --primary-color: #0277bd; /* Deep Tech Blue */
  --secondary-color: #29b6f6; /* Bright Sky Blue */
  --accent-color: #01579b; /* Navy Blue for accents */
  --bg-color: #f0f7ff; /* Very Light Blue-Grey */
  --text-color: #263238; /* Dark Blue-Grey */
  --header-bg: #ffffff;
  --footer-bg: #e1f5fe; /* Light Blue Footer */
  --footer-text: #455a64;
  --container-width: 1140px;
  --card-shadow: 0 4px 12px rgba(2, 119, 189, 0.08);
  --border-radius: 12px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--bg-color);
  background-image: linear-gradient(180deg, #e3f2fd 0%, #f0f7ff 100%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: all 0.2s ease;
  border-bottom: 1px solid transparent;
}

a:hover {
  color: var(--secondary-color);
  border-bottom-color: var(--secondary-color);
}

/* Layout */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

header {
  background-color: var(--header-bg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid #e1f5fe;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@media (max-width: 768px) {
  nav {
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 0.5rem;
  }
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo::before {
  content: '';
  display: block;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
  border-radius: 6px;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 25px;
}

.nav-links a {
  color: var(--text-color);
  font-weight: 600;
  padding: 5px 0;
}

.nav-links a:hover {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

main {
  padding: 3rem 0;
  min-height: 80vh;
}

footer {
  background-color: var(--footer-bg);
  color: var(--footer-text);
  padding: 3rem 0;
  text-align: center;
  margin-top: auto;
  border-top: 1px solid #b3e5fc;
}

footer a {
  color: var(--footer-text);
  margin: 0 10px;
  border-bottom: 1px dotted var(--footer-text);
}

footer a:hover {
  color: var(--primary-color);
  border-bottom-style: solid;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--accent-color);
}

h1 {
  font-size: 2.8rem;
  background: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  padding-bottom: 0.5rem;
  margin-bottom: 2rem;
  display: inline-block;
}

h2 {
  font-size: 2rem;
  margin-top: 2.5rem;
  border-left: 5px solid var(--secondary-color);
  padding-left: 15px;
}

h3 {
  font-size: 1.5rem;
  margin-top: 2rem;
  color: var(--primary-color);
}

p {
  margin-bottom: 1.2rem;
  font-size: 1.05rem;
}

ul, ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Components */
.btn {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 0.8rem 2rem;
  border-radius: 30px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: none;
  box-shadow: 0 4px 6px rgba(2, 119, 189, 0.2);
}

.btn:hover {
  background: linear-gradient(135deg, var(--accent-color), var(--primary-color));
  color: white;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(2, 119, 189, 0.3);
}

.card {
  background: white;
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  margin-bottom: 2rem;
  border: 1px solid #e1f5fe;
  transition: transform 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
}

/* Hero Section */
.hero {
  background: white;
  padding: 4rem 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  text-align: center;
  margin-bottom: 3rem;
  border: 1px solid #e1f5fe;
}

.hero h1 {
  margin-bottom: 1rem;
}

.hero p.lead {
  font-size: 1.25rem;
  color: var(--footer-text);
  max-width: 800px;
  margin: 0 auto 2rem;
}

/* AdSense CLS Armor - REQUIRED */
.ad-container-leaderboard {
  min-height: 90px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 30px 0;
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: inset 0 0 10px #f0f7ff;
  border: 1px dashed #b3e5fc;
}
@media (max-width: 768px) {
  .ad-container-leaderboard {
    min-height: 250px;
  }
}

/* Utility */
.text-center { text-align: center; }
.mt-4 { margin-top: 2rem; }
.mb-4 { margin-bottom: 2rem; }

/* Code blocks - Clean Light Terminal */
.code-wrapper {
  position: relative;
  margin-bottom: 2rem;
}

pre {
  background: #263238; /* Dark Blue-Grey base */
  color: #eceff1;
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  font-family: "SF Mono", "Consolas", "Monaco", monospace;
  border-left: 4px solid var(--secondary-color);
  box-shadow: 0 10px 20px rgba(0,0,0,0.15);
  padding-right: 80px; /* Space for button */
}

.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #eceff1;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 5px;
}

.copy-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.copy-btn.copied {
  background-color: var(--secondary-color);
  color: #263238;
}

code {
  font-family: "SF Mono", "Consolas", "Monaco", monospace;
  background-color: rgba(41, 182, 246, 0.1);
  padding: 2px 4px;
  border-radius: 4px;
  color: var(--primary-color);
}

pre code {
  background-color: transparent;
  color: inherit;
  padding: 0;
}

/* Table of Contents */
.toc-container {
  background: white;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  margin-bottom: 2rem;
  border: 1px solid #e1f5fe;
  max-width: 400px;
}

.toc-title {
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--accent-color);
  border-bottom: 2px solid #b3e5fc;
  padding-bottom: 0.5rem;
}

.toc-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 0;
}

.toc-item {
  margin-bottom: 0.5rem;
}

.toc-item a {
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.95rem;
  display: block;
  padding: 2px 0;
}

.toc-item a:hover {
  color: var(--primary-color);
  transform: translateX(5px);
}

.toc-h3 {
  padding-left: 1.5rem;
  font-size: 0.9rem;
  color: var(--footer-text);
}

/* Tables */
.table-container {
  overflow-x: auto;
  margin-bottom: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--card-shadow);
  background: white;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  background: white;
}

th {
  background-color: var(--bg-color);
  color: var(--accent-color);
  text-align: left;
  padding: 1.2rem;
  font-weight: 700;
  border-bottom: 2px solid #b3e5fc;
}

td {
  padding: 1.2rem;
  border-bottom: 1px solid #e1f5fe;
  color: var(--text-color);
}

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

tr:hover {
  background-color: #f0f7ff;
}
