:root {
  --bg: #fafaf8;
  --text: #2c2416;
  --link: #2c2416;
  --card: #ffffff;
  --border: #e8e3d8;
  --accent: #2c2416;
  --badge-bg: #2c2416;
  --list-bg: #ffffff;
  --list-text: #2c2416;
  --spiritual-blue: #2c2416;
  --sand: #2c2416;
}

[data-theme='dark'] {
  --bg: #1a1815;
  --text: #f5f1ed;
  --link: #f5f1ed;
  --card: #2a2520;
  --border: #3d3630;
  --accent: #f5f1ed;
  --badge-bg: #f5f1ed;
  --list-bg: #2a2520;
  --list-text: #f5f1ed;
  --spiritual-blue: #f5f1ed;
  --sand: #f5f1ed;
}

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

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: "Faculty Glyphic", "Georgia", serif;
  font-weight: 300;
  font-style: normal;
  font-size: 16px;
  transition: background-color 0.3s ease, color 0.3s ease;
  line-height: 1.8;
  letter-spacing: 0.3px;
}

/* Navigation */
.navbar {
  background-color: var(--card) !important;
  border-color: var(--border) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Container */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem;
}

/* Links */
a {
  color: var(--spiritual-blue);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  text-decoration: underline;
  opacity: 0.8;
  color: var(--sand);
}

/* Override Bootstrap's list-group styling */
.list-group-item {
  background-color: var(--list-bg) !important;
  color: var(--list-text) !important;
  border-color: var(--border) !important;
  transition: all 0.2s ease;
  border-left: 3px solid var(--text);
}

.list-group-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
  border-left-color: var(--text);
}

/* Cards */
.card {
  background-color: var(--card);
  border: 1px solid var(--border);
  padding: 30px;
  margin: 20px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.3s ease;
  border-left: 4px solid var(--spiritual-blue);
}

.card:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
  border-left-color: var(--sand);
}

/* Forms */
input[type="text"],
input[type="search"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border);
  background-color: var(--card);
  color: var(--text);
  margin-bottom: 1rem;
  font-size: 1rem;
  transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="search"]:focus {
  outline: none;
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(175, 134, 244, 0.1);
}

/* Buttons */
button, .btn {
  padding: 0.6rem 1.2rem;
  border: none;
  background-color: var(--spiritual-blue);
  color: white;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  font-size: 1rem;
}

a {
    text-decoration: underline !important;
}

button:hover,
.btn:hover {
  background-color: var(--sand);
  color: var(--spiritual-blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(27, 73, 101, 0.3);
}

.theme-toggle{
  display: none;
}
/* Fixed button styling override for theme toggle and back buttons */
.theme-toggle,
.back-button {
  padding: 0 !important;
  background: transparent !important;
  border: 2px solid var(--text);
  color: var(--text) !important;
  font-weight: normal !important;
  box-shadow: none !important;
  transform: none !important;
  text-decoration: none !important;
}

/* Login button (top-right) */
.login-button {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 10px 12px;
  border: 2px solid var(--text);
  background: transparent;
  color: var(--text);
  text-decoration: none;
  z-index: 1010;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.login-button:hover {
  background: transparent;
  color: var(--text);
  text-decoration: underline;
}

.theme-toggle:hover,
.back-button:hover {
  background: transparent !important;
  transform: none !important;
}

/* Badges */
.badge {
  background: var(--spiritual-blue);
  color: white;
  padding: 0.35rem 0.65rem;
  font-size: 0.75rem;
  margin-right: 0.3rem;
}

/* Code */
pre {
  padding: 15px;
  font-family: "Courier New", monospace;
  background-color: var(--list-bg);
  color: var(--text);
  overflow-x: auto;
  margin: 1rem 0;
}

code {
  color: var(--link);
  font-weight: 500;
  font-size: 0.9rem;
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem 0;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--spiritual-blue);
  letter-spacing: 0.5px;
}

h1 {
  font-size: 2.5rem;
  border-bottom: 2px solid var(--sand);
  padding-bottom: 0.5rem;
}

h2 {
  font-size: 1.8rem;
}

h3 {
  font-size: 1.4rem;
}

/* Paragraphs */
p {
  margin: 1rem 0;
  line-height: 1.8;
}

/* Blockquotes */
blockquote {
  padding: 1.5rem;
  border-left: 4px solid var(--spiritual-blue);
  background-color: rgba(27, 73, 101, 0.03);
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--text);
}

/* Graph */
#graph {
  width: 100%;
  height: 400px;
  border: 2px solid var(--border);
  margin: 1.5rem 0;
  background-color: var(--card);
}

/* ========================================
   DIFF VIEW STYLES
   ======================================== */

.diff-view {
  font-family: 'SF Mono', 'Consolas', 'Monaco', 'Liberation Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.diff-file {
  margin-bottom: 1rem;
}

.diff-file:last-child {
  margin-bottom: 0;
}

.diff-file-header {
  background: var(--border);
  color: var(--text);
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
}

.diff-hunk-header {
  background: rgba(100, 149, 237, 0.15);
  color: var(--text);
  padding: 6px 16px;
  font-size: 0.8rem;
  opacity: 0.85;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.diff-line {
  display: flex;
  padding: 0;
  border: none;
  min-height: 1.5em;
}

.diff-marker {
  flex-shrink: 0;
  width: 24px;
  text-align: center;
  user-select: none;
  font-weight: bold;
  padding: 2px 0;
}

.diff-content {
  flex: 1;
  padding: 2px 12px 2px 8px;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-wrap: anywhere;
}

.diff-add {
  background: rgba(46, 160, 67, 0.2);
}

.diff-add .diff-marker {
  color: #2ea043;
  background: rgba(46, 160, 67, 0.3);
}

.diff-del {
  background: rgba(248, 81, 73, 0.2);
}

.diff-del .diff-marker {
  color: #f85149;
  background: rgba(248, 81, 73, 0.3);
}

.diff-ctx {
  background: transparent;
}

.diff-ctx .diff-marker {
  color: var(--text);
  opacity: 0.4;
}

[data-theme='dark'] .diff-add {
  background: rgba(63, 185, 80, 0.15);
}

[data-theme='dark'] .diff-add .diff-marker {
  color: #3fb950;
  background: rgba(63, 185, 80, 0.25);
}

[data-theme='dark'] .diff-del {
  background: rgba(248, 81, 73, 0.15);
}

[data-theme='dark'] .diff-del .diff-marker {
  color: #f85149;
  background: rgba(248, 81, 73, 0.25);
}

[data-theme='dark'] .diff-hunk-header {
  background: rgba(88, 166, 255, 0.1);
}

/* ========================================
   RESPONSIVE STYLES
   ======================================== */

/* Tablet and smaller (max-width: 992px) */
@media (max-width: 992px) {
  .container {
    max-width: 100%;
    padding: 0.75rem;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .card {
    padding: 20px;
    margin: 15px 0;
  }

  /* Login button adjustments */
  .login-button {
    padding: 8px 10px;
    font-size: 0.9rem;
  }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
  body {
    font-size: 15px;
    line-height: 1.7;
  }

  .container {
    padding: 0.5rem;
  }

  h1 {
    font-size: 1.6rem;
    padding-bottom: 0.4rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  h3 {
    font-size: 1.15rem;
  }

  .card {
    padding: 15px;
    margin: 10px 0;
    border-left-width: 3px;
  }

  /* Fixed buttons - smaller and repositioned */
  .back-button,
  .theme-toggle {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
    top: 12px;
  }

  .back-button {
    left: 12px;
  }

  .theme-toggle {
    right: 12px;
  }

  .login-button {
    top: 12px;
    right: 12px;
    padding: 6px 10px;
    font-size: 0.85rem;
  }

  /* Logo container - responsive sizing */
  .logo-container {
    padding: 15px 10px;
    margin-bottom: 15px;
  }

  .logo-container img {
    max-width: 200px;
  }

  /* Search input */
  .search-input {
    padding: 14px 16px;
    font-size: 1rem;
  }

  /* Mandala grid - 2 columns on mobile */
  .mandala-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .mandala-card {
    padding: 18px 12px;
  }

  .mandala-title {
    font-size: 0.95rem;
  }

  /* Section titles */
  .section-title {
    font-size: 1.4rem;
    margin-bottom: 20px;
  }

  /* Featured section */
  .featured-section {
    margin-top: 40px;
    padding: 25px 15px;
  }

  /* Mandala intro */
  .mandala-intro {
    padding: 20px;
    font-size: 0.95rem;
    margin: 20px auto;
  }

  /* Tabs - scrollable on mobile */
  .nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .nav-tabs .nav-link {
    padding: 10px 14px;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  /* Note tabs */
  .note-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .note-tabs .nav-link {
    padding: 10px 12px;
    font-size: 0.85rem;
  }

  /* Graph container */
  #graph {
    height: 300px;
  }

  /* Links list */
  .links-list li {
    padding: 10px 0;
  }

  .links-list a {
    font-size: 0.95rem;
  }

  /* Blockquotes */
  blockquote {
    padding: 1rem;
    margin: 1rem 0;
  }

  /* Pre/code blocks */
  pre {
    padding: 12px;
    font-size: 0.85rem;
  }

  /* Modal adjustments */
  .modal-dialog {
    margin: 10px;
  }

  .modal-body {
    padding: 15px;
  }

  .modal-body textarea {
    font-size: 0.9rem;
  }

  /* List group items */
  .list-group-item {
    padding: 12px;
    font-size: 0.9rem;
  }

  /* Buttons */
  button, .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  /* Badges */
  .badge {
    padding: 0.3rem 0.5rem;
    font-size: 0.7rem;
  }

  /* Container fluid - less top padding */
  .container-fluid {
    padding-top: 60px;
  }
}

/* Small mobile (max-width: 480px) */
@media (max-width: 480px) {
  body {
    font-size: 14px;
  }

  h1 {
    font-size: 1.4rem;
  }

  h2 {
    font-size: 1.2rem;
  }

  h3 {
    font-size: 1.05rem;
  }

  .container {
    padding: 0.4rem;
  }

  .card {
    padding: 12px;
    margin: 8px 0;
  }

  /* Mandala grid - single column on very small screens */
  .mandala-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Logo even smaller */
  .logo-container img {
    max-width: 160px;
  }

  /* Fixed buttons - even smaller */
  .back-button,
  .theme-toggle {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    top: 10px;
  }

  .back-button {
    left: 10px;
  }

  .login-button {
    top: 10px;
    right: 10px;
    padding: 5px 8px;
    font-size: 0.8rem;
  }

  /* Search container */
  .search-container {
    margin: 25px auto;
  }

  .search-input {
    padding: 12px 14px;
    font-size: 0.95rem;
  }

  /* Section titles */
  .section-title {
    font-size: 1.2rem;
  }

  /* Featured section */
  .featured-section {
    margin-top: 30px;
    padding: 20px 10px;
    border-left-width: 3px;
  }

  /* Mandala intro */
  .mandala-intro {
    padding: 15px;
    font-size: 0.9rem;
    border-left-width: 3px;
  }

  /* Tabs */
  .nav-tabs .nav-link {
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  .note-tabs .nav-link {
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  /* Graph */
  #graph {
    height: 250px;
  }

  /* Modal */
  .modal-dialog {
    margin: 5px;
  }

  .modal-header,
  .modal-footer {
    padding: 10px 15px;
  }

  .modal-title {
    font-size: 1.1rem;
  }

  /* Autocomplete */
  .autocomplete-item {
    padding: 10px 14px;
    font-size: 0.9rem;
  }

  /* Container fluid */
  .container-fluid {
    padding-top: 55px;
    padding-left: 10px;
    padding-right: 10px;
  }
}

/* Orientation: Landscape on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .logo-container {
    padding: 10px;
    margin-bottom: 10px;
  }

  .logo-container img {
    max-width: 150px;
  }

  .container-fluid {
    padding-top: 50px;
  }

  #graph {
    height: 200px;
  }
}

/* Print styles */
@media print {
  .back-button,
  .theme-toggle,
  .login-button,
  .nav-tabs,
  .btn {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .card {
    border: 1px solid #ccc;
    box-shadow: none;
  }
}

