/* ========================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   ======================================== */
:root {
  /* Backgrounds */
  --body-bg: #101215;
  --card-bg: #101215;
  --article-bg: #0d1117;
  --prism-bg: #2d3748;

  /* Text Colors */
  --text-color: #ebeff3;
  --text-post-title: #ffffff;
  --text-post-p: #f0f6fc; /* Paragraph text in posts */
  --text-card-title: #ffffff;
  --text-card-subtitle: #58a6ff;
  --text-emphasis: #065c03;
  --prism-text: #e2e8f0;
  --prism-comment: #718096;
  --prism-keyword: #90cdf4;
  --prism-string: #68d391;
  --prism-function: #f687b3;
  --prism-number: #f6ad55;
  --prism-operator: #fc8181;

  /* Add inline code variables */
  --inline-code-bg: #161b22;
  --inline-code-text: #f85149;

  --bodyFont: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica,
    Arial, sans-serif;
}

[data-theme="light"] {
  --body-bg: #f8f9fa;
  --card-bg: #e1ebf6;
  --code-bg: #f0f6fc;
  --article-bg: #ffffff;
  --text-color: #212529;
  --text-post-title: #0f172a;
  --text-post-p: #24292e;
  --text-card-title: #0f172a;
  --text-card-subtitle: #0366d6;

  /* Prism color variables for light mode */
  --prism-bg: #f7fafc;
  --prism-text: #2d3748;
  --prism-comment: #718096;
  --prism-keyword: #3182ce;
  --prism-string: #38a169;
  --prism-function: #d53f8c;
  --prism-number: #dd6b20;
  --prism-operator: #e53e3e;

  /* Inline code variables for light mode */
  --inline-code-bg: #bbc8d5;
  --inline-code-text: #d73a49;
}

/* ========================================
   BASE STYLES
   ======================================== */

html,
body {
  visibility: visible;
  overflow-x: hidden;
  overflow-y: auto;
  width: 100%;
  min-height: 100%;
  position: relative;
  overscroll-behavior: none;
}

body {
  background-color: var(--body-bg);
  color: var(--text-color);
  margin: 0;
  font-family: var(--bodyFont);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ========================================
   NAVBAR STYLES
   ======================================== */

.navbar {
  font-family: var(--bodyFont);
  background: var(--body-bg);
  z-index: 1030;
  transform: translateZ(0);
  will-change: transform;
  transition: background 0.3s ease;
}

.navbar .navbar-brand,
.navbar .navbar-brand h3 {
  color: var(--text-color) !important;
  font-family: inherit;
  transition: color 0.3s ease;
}

.navbar .nav-link {
  color: var(--text-color) !important;
  transition: color 0.3s ease;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
  color: var(--text-color) !important;
  opacity: 0.8;
}

/* ========================================
   FOOTER STYLES
   ======================================== */
footer {
  margin-top: auto;
  background: var(--body-bg) !important;
  border-top: 1px solid var(--border-color);
  transition: background 0.3s ease, color 0.3s ease;
  color: #505353 !important;
}

footer a {
  transition: all 0.3s ease;
}

footer a:hover {
  text-decoration: none !important;
  opacity: 0.7;
  color: #58a6ff;
  transform: translateY(-2px);
  transition: all 0.3s ease;
}

footer a img {
  transition: all 0.3s ease;
}

footer a:hover img {
  filter: brightness(0.8);
}

/* ========================================
   ANIMATIONS
   ======================================== */
.fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s ease-out forwards;
}

.fade-in-up.delay-1 {
  animation-delay: 0.1s;
}

.fade-in-up.delay-2 {
  animation-delay: 0.2s;
}

.fade-in-up.delay-3 {
  animation-delay: 0.3s;
}

.fade-in-up.delay-4 {
  animation-delay: 0.4s;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fade-in-up {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ========================================
   LAYOUT UTILITIES
   ======================================== */
main {
  flex: 1;
  overflow: visible;
}

.min-vh-50 {
  min-height: 50vh;
}

/* ========================================
   COMPONENT STYLES
   ======================================== */
/* Company logo styling */
.company-logo {
  max-width: 120px;
  max-height: 80px;
  width: auto;
  height: auto;
  object-fit: contain;
}

@media (max-width: 767.98px) {
  .company-logo {
    max-width: 100px;
    max-height: 70px;
  }
}

/* Text styling */
.text-emphasis {
  color: var(--text-emphasis) !important;
}

.text-light-emphasis {
  color: #e6edf3 !important;
}

.devicon {
  transition: all 0.3s ease;
}

.list-group-item:hover .devicon {
  transform: scale(1.1);
}

.btn {
  transition: all 0.3s ease;
  color: var(--text-color);
  font-weight: 500;
}

.btn:hover {
  color: var(--text-color);
  background-color: var(--body-bg);
}

.gradient-accent {
  background: linear-gradient(45deg, #0dcaf0, #198754, #ffc107);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */
@media (max-width: 767.98px) {
  /* better spacing on mobile */
  .card .row {
    text-align: center;
  }

  /* Stack content vertically on mobile */
  .card .col-12 {
    margin-bottom: 1rem;
  }

  .card .col-12:last-child {
    margin-bottom: 0;
  }
}

/* ========================================
   CARD STYLES
   ======================================== */

.card {
  transition: all 0.3s ease;
  border-radius: 5px !important;
  background: var(--card-bg);
  font-family: var(--bodyFont);
}

.card .card-body {
  color: var(--text-color) !important;
}

.card span {
  color: var(--text-color) !important;
}

.card .card-title {
  color: var(--text-card-title) !important;
  font-family: var(--bodyFont);
}

.card .card-title a {
  color: var(--text-card-title) !important;
  transition: color 0.3s ease;
}

.card .card-title a:hover {
  color: var(--text-card-subtitle) !important;
  opacity: 0.8;
}

.card .card-subtitle {
  color: var(--text-card-subtitle) !important;
}

/* Override Bootstrap text utilities in cards */
.card .text-decoration-none {
  color: var(--text-card-title) !important;
}

.card .text-secondary {
  color: var(--text-color) !important;
  opacity: 0.7;
}

.card .card-header h4 {
  color: var(--text-card-title) !important;
}

/* ========================================
   ARTICLE STYLES
   ======================================== */
.article {
  background: var(--body-bg);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.text-light-emphasis {
  color: #e6edf3 !important;
}

/* ========================================
   ACCORDION STYLES
   ======================================== */
.accordion-button {
  background: var(--body-bg) !important;
  border: 1px solid var(--border-color);
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}

.accordion-button::after {
  filter: invert(1);
  transition: filter 0.3s ease;
}

.accordion-button:not(.collapsed) {
  box-shadow: inset 0 -1px 0 var(--border-color);
}

.accordion-body {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-top: none;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ========================================
   BLOG STYLES
   ======================================== */

.blog-title {
  color: var(--text-post-title);
  font-size: 3rem;
}

.blog-content {
  line-height: 1.8;
  font-size: 1.1rem;
  color: #c9d1d9;
}
.blog-content p,
.blog-content li {
  color: var(--text-post-p);
}

.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4 {
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-color);
}

.blog-content h1 {
  font-size: 2.5rem;
}
.blog-content h2 {
  font-size: 2rem;
}
.blog-content h3 {
  font-size: 1.5rem;
}
.blog-content pre {
  background-color: var(--code-bg) !important;
  padding: 1.5rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  border-left: 4px solid #58a6ff;
}
.blog-content blockquote {
  border-left: 4px solid #30363d;
  padding-left: 1.5rem;
  margin: 2rem 0;
  color: #8b949e;
  font-style: italic;
  background-color: #161b22;
  padding: 1rem 1.5rem;
  border-radius: 0.25rem;
}
.blog-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  margin: 1rem 0;
}
.blog-content code {
  background-color: var(--inline-code-bg);
  color: var(--inline-code-text);
  padding: 0.2rem 0.4rem;
  border-radius: 0.25rem;
  font-family: "Share Tech Mono", monospace !important;
  transition: background-color 0.3s ease, color 0.3s ease;
  font-size: 0.9rem !important;
}

.blog-content p code,
.blog-content li code {
  background-color: var(--inline-code-bg);
  color: var(--inline-code-text);
}

/* Keep code blocks transparent (let Prism handle them) */
.blog-content pre code {
  background: transparent;
  padding: 0;
  color: inherit; /* Inherit from Prism styling */
}

/* ========================================
   BREADCRUMB STYLES
   ======================================== */
.breadcrumb-item + .breadcrumb-item::before {
  color: var(--text-color) !important;
  transition: color 0.3s ease;
}

.breadcrumb-item.active {
  color: var(--text-color) !important;
  transition: color 0.3s ease;
}

/* Strip button test */
.stripe-button {
  appearance: button;
  backface-visibility: hidden;
  background-color: #405cf5;
  border-radius: 6px;
  border-width: 0;
  box-shadow: rgba(50, 50, 93, 0.1) 0 0 0 1px inset,
    rgba(50, 50, 93, 0.1) 0 2px 5px 0, rgba(0, 0, 0, 0.07) 0 1px 1px 0;
  box-sizing: border-box;
  color: #fff;
  cursor: pointer;
  font-size: 100%;
  height: 35px;
  line-height: 1.15;
  margin: 12px 0 0;
  outline: none;
  overflow: hidden;
  padding: 0 25px;
  position: relative;
  text-align: center;
  text-transform: none;
  transform: translateZ(0);
  transition: all 0.2s, box-shadow 0.08s ease-in;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  width: auto;
  display: flex;
  text-decoration: none;
  vertical-align: middle;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.stripe-button:focus {
  box-shadow: rgba(50, 50, 93, 0.1) 0 0 0 1px inset,
    rgba(50, 50, 93, 0.2) 0 6px 15px 0, rgba(0, 0, 0, 0.1) 0 2px 2px 0,
    rgba(50, 151, 211, 0.3) 0 0 0 4px;
}

/* Apply custom Prism styling */
.blog-content pre[class*="language-"],
.blog-content code[class*="language-"] {
  background: var(--prism-bg) !important;
  color: var(--prism-text) !important;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.blog-content .token.comment,
.blog-content .token.prolog,
.blog-content .token.doctype,
.blog-content .token.cdata {
  color: var(--prism-comment) !important;
}

.blog-content .token.keyword {
  color: var(--prism-keyword) !important;
}

.blog-content .token.string {
  color: var(--prism-string) !important;
}

.blog-content .token.function {
  color: var(--prism-function) !important;
}

.blog-content .token.number {
  color: var(--prism-number) !important;
}

.blog-content .token.operator {
  color: var(--prism-operator) !important;
}
