/* ---------- Page Layout ---------- */

body{
background:#f5f7fb;
font-family: Arial, sans-serif;
}

/* ---------- Navbar ---------- */

.navbar{
background:#0d6efd;
}

.navbar-brand{
font-weight:bold;
font-size:20px;
}

/* ---------- Sidebar ---------- */

.sidebar{
background:#ffffff;
border-right:1px solid #e5e5e5;
}

.nav-link{
color:#333;
padding:8px;
border-radius:6px;
transition:0.2s;
}

.nav-link:hover{
background:#e9ecef;
padding-left:12px;
}

.nav-link.active{
background:#0d6efd;
color:white !important;
}

/* ---------- Cards ---------- */

.card{
border:none;
border-radius:10px;
transition:0.3s;
}

.card:hover{
transform:translateY(-5px);
box-shadow:0 10px 20px rgba(0,0,0,0.1);
}

/* ---------- Code Blocks ---------- */

pre{
position:relative;
background:#1e1e1e;
color:white;
padding:16px;
border-radius:8px;
overflow-x:auto;
margin-top:10px;
}

.card code{
background:#111827;
color:#22c55e;
padding:4px 8px;
border-radius:6px;
font-family:monospace;
font-size:14px;
}

/* ---------- Copy Button ---------- */

.copy-btn{
position:absolute;
right:10px;
top:5px;
background:none;
border:none;
color:white;
cursor:pointer;
}

.copy-btn:hover{
background:#444;
}

.code-header{
background:#111;
color:white;
font-size:12px;
padding:6px 10px;
border-top-left-radius:6px;
border-top-right-radius:6px;
}

.code-block{
position:relative;
}

#progressBar{
position: fixed;
top:0;
left:0;
height:4px;
background:#0d6efd;
width:0%;
z-index:1000;
}

.card table{
width:100%;
border-collapse: collapse;
margin-top:20px;
}

.card th,
.card td{
border:1px solid #ddd;
padding:10px;
text-align:left;
}

.card th{
background:#f8f9fa;
}

/* TOC */

.toc ul{
list-style:none;
padding-left:0;
font-size:14px;
}

.toc li{
margin-bottom:6px;
}

.toc a{
text-decoration:none;
color:#0d6efd;
}

.toc a:hover{
text-decoration:underline;
}

/* Sticky TOC */

.col-md-2{
position:sticky;
top:20px;
height:100vh;
overflow:auto;
}

/* Navbar Base */
.navbar {
    background: #0f172a;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Container */
.nav-container {
    width: 90%;
    margin: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo */
.logo a {
    color: #38bdf8;
    font-size: 22px;
    font-weight: bold;
    text-decoration: none;
}

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

.nav-links li a {
    color: #e2e8f0;
    text-decoration: none;
    font-size: 16px;
    transition: 0.3s;
}

/* Hover + Active */
.nav-links li a:hover,
.nav-links li a.active {
    color: #38bdf8;
    border-bottom: 2px solid #38bdf8;
}

/* Buttons */
.btn {
    padding: 6px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
}

.login {
    background: #38bdf8;
    color: black;
}

.logout {
    background: #ef4444;
    color: white;
}

/* Mobile */
.menu-toggle {
    display: none;
    font-size: 24px;
    color: white;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background: #0f172a;
        flex-direction: column;
        align-items: center;
        display: none;
    }

    .nav-links.show {
        display: flex;
    }

    .menu-toggle {
        display: block;
    }
}

.copy-btn {
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    padding: 5px 8px;
    font-size: 14px;
    border-radius: 5px;
    cursor: pointer;
}

.copy-btn i {
    pointer-events: none;
}

/* ================================================= */
/* DARK MODE */
/* ================================================= */

body{
    transition: background 0.3s ease, color 0.3s ease;
}

/* Toggle Button */

.theme-toggle{
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s;
    font-size: 18px;
}

.theme-toggle:hover{
    background: rgba(255,255,255,0.1);
}

/* DARK MODE BODY */

body.dark-mode{
    background: #0f172a;
    color: #e2e8f0;
}

/* Cards */

body.dark-mode .card{
    background: #1e293b;
    color: #e2e8f0;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

/* Sidebar */

body.dark-mode .bg-light{
    background: #111827 !important;
}

/* Text */

body.dark-mode p,
body.dark-mode li,
body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6{
    color: #e2e8f0;
}

body.dark-mode .text-muted{
    color: #94a3b8 !important;
}

/* Links */

body.dark-mode .nav-link{
    color: #e2e8f0;
}

body.dark-mode .nav-link:hover{
    background: #1e293b;
}

/* Tables */

body.dark-mode table{
    color: white;
}

body.dark-mode th{
    background: #1e293b;
}

body.dark-mode td,
body.dark-mode th{
    border-color: #334155;
}

/* Inputs */

body.dark-mode input{
    background: #1e293b;
    border: 1px solid #334155;
    color: white;
}

body.dark-mode input::placeholder{
    color: #94a3b8;
}

/* Tutorial Content */

body.dark-mode .border-start{
    border-color: #334155 !important;
}

/* Footer */

body.dark-mode footer{
    color: #94a3b8 !important;
}

/* Code */

body.dark-mode pre{
    background: #020617;
}

/* Smooth */

.card,
.nav-link,
input,
pre{
    transition: all 0.3s ease;
}