/* CloudNinja.us - Custom Styles & Theme System */

/* ===== Theme Variables ===== */
:root {
  /* Dark Theme (default) */
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --accent-glow: rgba(56, 189, 248, 0.15);
  --border: #334155;
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --card-hover-shadow: 0 10px 25px -5px rgba(56, 189, 248, 0.15);
  --code-bg: #0d1117;
  --code-border: #30363d;
  --nav-bg: rgba(15, 23, 42, 0.95);
  --hero-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  --card-gradient: linear-gradient(145deg, #1e293b, #253349);
  --callout-bg: rgba(56, 189, 248, 0.08);
  --callout-border: #38bdf8;
  --input-bg: #1e293b;
  --footer-bg: #0b1120;
}

[data-theme="light-clean"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent: #0284c7;
  --accent-hover: #0369a1;
  --accent-glow: rgba(2, 132, 199, 0.1);
  --border: #e2e8f0;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
  --card-hover-shadow: 0 10px 25px -5px rgba(2, 132, 199, 0.12);
  --code-bg: #f1f5f9;
  --code-border: #e2e8f0;
  --nav-bg: rgba(255, 255, 255, 0.95);
  --hero-gradient: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f0f9ff 100%);
  --card-gradient: linear-gradient(145deg, #ffffff, #f8fafc);
  --callout-bg: rgba(2, 132, 199, 0.06);
  --callout-border: #0284c7;
  --input-bg: #ffffff;
  --footer-bg: #f1f5f9;
}

[data-theme="light-warm"] {
  --bg-primary: #faf9f7;
  --bg-secondary: #ffffff;
  --bg-tertiary: #e7e5e4;
  --text-primary: #1c1917;
  --text-secondary: #57534e;
  --text-muted: #a8a29e;
  --accent: #0891b2;
  --accent-hover: #0e7490;
  --accent-glow: rgba(8, 145, 178, 0.1);
  --border: #e7e5e4;
  --card-shadow: 0 1px 3px rgba(28, 25, 23, 0.06), 0 1px 2px rgba(28, 25, 23, 0.04);
  --card-hover-shadow: 0 10px 25px -5px rgba(8, 145, 178, 0.1);
  --code-bg: #f5f5f4;
  --code-border: #e7e5e4;
  --nav-bg: rgba(250, 249, 247, 0.95);
  --hero-gradient: linear-gradient(135deg, #faf9f7 0%, #ecfeff 50%, #faf9f7 100%);
  --card-gradient: linear-gradient(145deg, #ffffff, #faf9f7);
  --callout-bg: rgba(8, 145, 178, 0.06);
  --callout-border: #0891b2;
  --input-bg: #ffffff;
  --footer-bg: #f5f5f4;
}

/* ===== Base Styles ===== */
body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ===== Navigation ===== */
.nav-main {
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.nav-link {
  color: var(--text-secondary);
  transition: color 0.2s ease;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* ===== Logo ===== */
.logo-text {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
  letter-spacing: -0.025em;
}

/* ===== Cards ===== */
.card {
  background: var(--card-gradient);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  box-shadow: var(--card-shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-hover-shadow);
  border-color: var(--accent);
}

/* ===== Hero Section ===== */
.hero {
  background: var(--hero-gradient);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: radial-gradient(circle at 25% 25%, var(--accent-glow) 0%, transparent 50%),
                     radial-gradient(circle at 75% 75%, var(--accent-glow) 0%, transparent 50%);
  pointer-events: none;
}

/* Grid pattern overlay */
.hero-grid {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.15;
  pointer-events: none;
}

/* ===== Tags ===== */
.tag {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  background: var(--accent-glow);
  color: var(--accent);
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.tag:hover {
  border-color: var(--accent);
}

/* ===== Category Tags ===== */
.cat-citrix { background: rgba(239, 68, 68, 0.1); color: #f87171; }
.cat-azure { background: rgba(59, 130, 246, 0.1); color: #60a5fa; }
.cat-proxmox { background: rgba(251, 146, 60, 0.1); color: #fb923c; }
.cat-claude { background: rgba(168, 85, 247, 0.1); color: #a78bfa; }
.cat-automation { background: rgba(34, 197, 94, 0.1); color: #4ade80; }
.cat-sideproject { background: rgba(236, 72, 153, 0.1); color: #f472b6; }

[data-theme="light-clean"] .cat-citrix,
[data-theme="light-warm"] .cat-citrix { background: rgba(239, 68, 68, 0.08); color: #dc2626; }
[data-theme="light-clean"] .cat-azure,
[data-theme="light-warm"] .cat-azure { background: rgba(59, 130, 246, 0.08); color: #2563eb; }
[data-theme="light-clean"] .cat-proxmox,
[data-theme="light-warm"] .cat-proxmox { background: rgba(251, 146, 60, 0.08); color: #ea580c; }
[data-theme="light-clean"] .cat-claude,
[data-theme="light-warm"] .cat-claude { background: rgba(168, 85, 247, 0.08); color: #7c3aed; }
[data-theme="light-clean"] .cat-automation,
[data-theme="light-warm"] .cat-automation { background: rgba(34, 197, 94, 0.08); color: #16a34a; }
[data-theme="light-clean"] .cat-sideproject,
[data-theme="light-warm"] .cat-sideproject { background: rgba(236, 72, 153, 0.08); color: #db2777; }

/* ===== Code Blocks ===== */
.code-block {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 0.5rem;
  padding: 1.25rem;
  overflow-x: auto;
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.875rem;
  line-height: 1.7;
}

code:not(.code-block code) {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85em;
}

/* ===== Callout Box ===== */
.callout {
  background: var(--callout-bg);
  border-left: 4px solid var(--callout-border);
  border-radius: 0 0.5rem 0.5rem 0;
  padding: 1.25rem 1.5rem;
}

/* ===== Form Inputs ===== */
.form-input {
  background: var(--input-bg);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ===== Buttons ===== */
.btn-primary {
  background: var(--accent);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.15s ease;
  display: inline-block;
  text-align: center;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-outline {
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.6rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-block;
  text-align: center;
}

.btn-outline:hover {
  background: var(--accent-glow);
}

/* ===== Theme Switcher ===== */
.theme-switcher {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg-tertiary);
  border-radius: 9999px;
  padding: 0.2rem;
}

.theme-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.theme-btn:hover {
  color: var(--text-primary);
}

.theme-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ===== Section Headings ===== */
.section-heading {
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.025em;
}

.section-heading span {
  color: var(--accent);
}

/* ===== Footer ===== */
.footer {
  background: var(--footer-bg);
  border-top: 1px solid var(--border);
  transition: background 0.3s ease, border-color 0.3s ease;
}

/* ===== Blog Post Typography ===== */
.prose-custom h2 {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.5rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.prose-custom h3 {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 1.25rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.prose-custom p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

.prose-custom ul, .prose-custom ol {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.prose-custom li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.prose-custom a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.prose-custom a:hover {
  color: var(--accent-hover);
}

.prose-custom blockquote {
  border-left: 4px solid var(--accent);
  padding-left: 1.25rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}

.prose-custom img {
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* ===== Sidebar ===== */
.sidebar-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.sidebar-section h3 {
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-link {
  display: block;
  color: var(--text-secondary);
  padding: 0.4rem 0;
  transition: color 0.2s ease;
  font-size: 0.9rem;
}

.sidebar-link:hover {
  color: var(--accent);
}

/* ===== Placeholder Image ===== */
.img-placeholder {
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  border-radius: 0.5rem;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ===== Mobile Menu ===== */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.mobile-menu.open {
  max-height: 400px;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }
