/* ========== Base ========== */
html{
  height: 100vh;
  width: 100%;
}

body {
  height: 100vh;
  width: 100%;
  background: #f0f2f5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.mybox {
    height: calc(100vh - 175px);
}

/* ========== Navbar ========== */
#mainNav {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
#mainNav .input-group-text,
#mainNav .form-control {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.15);
  color: #fff;
  transition: background 0.2s;
}
#mainNav .form-control::placeholder {
  color: rgba(255,255,255,0.4);
}
#mainNav .form-control:focus {
  background: rgba(255,255,255,0.18);
  box-shadow: none;
  border-color: rgba(255,255,255,0.3);
}

/* ========== Sidebar ========== */
.sidebar {
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  background: #fff;
  border-radius: 12px;
}
.sidebar::-webkit-scrollbar {
  width: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}
#noteNav .nav-link {
  color: #495057;
  cursor: pointer;
  border-radius: 8px;
  padding: 6px 10px;
  margin-bottom: 2px;
  font-size: 0.9rem;
  transition: all 0.15s;
}
#noteNav .nav-link:hover {
  background: #e9ecef;
  color: #0d6efd;
}
#noteNav .nav-link.active {
  background: #0d6efd;
  color: #fff;
}

/* ========== Tags ========== */
.tag-badge {
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}
.tag-badge:hover {
  opacity: 0.8;
  transform: scale(1.05);
}

/* ========== Hero ========== */
.hero-card {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #fff;
}

/* ========== Stat Cards ========== */
.stat-card {
  background: #fff;
  border: 1px solid rgba(0,0,0,0.04);
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08) !important;
}

/* ========== Note Cards ========== */
.note-card {
  cursor: pointer;
  border: none;
  border-radius: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.note-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.1) !important;
}
.note-card .card-body {
  padding: 1.25rem;
}
.note-card .card-title {
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========== Markdown Body ========== */
.markdown-body {
  line-height: 1.8;
  color: #2c3e50;
}
.markdown-body h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
  font-size: 1.4rem;
}
.markdown-body h4 {
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 1.2rem;
}
.markdown-body h5 {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 1.05rem;
  color: #0d6efd;
}
.markdown-body p {
  margin-bottom: 0.75rem;
}
.markdown-body pre {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 1rem 0;
}
.markdown-body code {
  background: #eef0f4;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-size: 0.875em;
  color: #e02f6b;
}
.markdown-body pre code {
  background: none;
  padding: 0;
  color: inherit;
}
.markdown-body blockquote {
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  background: #f8f9fa;
  border-radius: 8px;
}
.markdown-body table {
  margin: 1rem 0;
}
.markdown-body table th {
  background: #f8f9fa;
}
.markdown-body li {
  margin-bottom: 0.25rem;
}

/* ========== Footer ========== */
footer {
  background: #fff;
  border-top: 1px solid #e9ecef;
}

/* ========== Animations ========== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
#welcome > * {
  animation: fadeInUp 0.35s ease both;
}
#welcome > *:nth-child(2) { animation-delay: 0.05s; }
#welcome > *:nth-child(3) { animation-delay: 0.1s; }

/* ========== Responsive ========== */
@media (max-width: 991.98px) {
  .sidebar {
    position: static;
    max-height: none;
  }
}
