:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --bg-light: #f8f9fa;
    --text-dark: #2c3e50;
    --border-color: #dee2e6;
    --card-bg: #ffffff;
    --code-bg: #2d3748;
    --code-text: #e2e8f0;
    --shadow: rgba(0,0,0,0.08);
    --shadow-hover: rgba(0,0,0,0.1);
}

[data-theme="dark"] {
    --primary-color: #63b3ed;
    --secondary-color: #4299e1;
    --accent-color: #fc8181;
    --bg-light: #0f172a;
    --text-dark: #e2e8f0;
    --border-color: #1e293b;
    --card-bg: #1e293b;
    --code-bg: #0f172a;
    --code-text: #e2e8f0;
    --shadow: rgba(0,0,0,0.5);
    --shadow-hover: rgba(0,0,0,0.6);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    background-color: var(--bg-light);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
}

.theme-switch {
    position: relative;
    display: inline-block;
    cursor: pointer;
    width: 60px;
    height: 34px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--secondary-color);
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: var(--bg-light);
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider { background-color: var(--secondary-color); }
input:checked + .slider:before { transform: translateX(26px); }

.theme-icon { position: absolute; top: 50%; transform: translateY(-50%); font-size: 14px; transition: opacity 0.3s ease; }
.sun-icon { left: 8px; color: #f39c12; }
.moon-icon { right: 8px; color: #bcc7d3ff; }
input:checked ~ .sun-icon { opacity: 0; }
input:not(:checked) ~ .moon-icon { opacity: 0; }

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    overflow-y: auto;
    z-index: 1000;
    transition: all 0.3s ease;
}
.sidebar .logo { color: var(--primary-color); font-size: 1.5rem; font-weight: bold; margin-bottom: 20px; text-align: center; padding-bottom: 8px; border-bottom: 1px solid var(--border-color); transition: color 0.3s ease, border-color 0.3s ease; }
.sidebar .nav-link { color: var(--text-dark); padding: 5px 8px; border-radius: 8px; margin-bottom: 2px; transition: all 0.3s ease; text-decoration: none; display: block; background: transparent; font-size: 1rem; }
.sidebar .nav-link:hover { color: var(--secondary-color); background: rgba(52, 152, 219, 0.1); transform: translateX(5px); }
.sidebar .nav-link.active { color: white; background: var(--secondary-color); transform: translateX(5px); }
.sidebar .nav-link i { margin-right: 10px; width: 20px; text-align: center; color: #dc3545; transition: color 0.3s ease; }
.sidebar .nav-link.active i { color: var(--bg-light); }

.main-content { margin-left: 280px; padding: 40px; min-height: 100vh; background: var(--bg-light); color: var(--text-dark); transition: background-color 0.3s ease, color 0.3s ease, margin-left 0.3s ease, padding 0.3s ease; }

.mobile-toggle { display: none; position: fixed; top: 20px; left: 20px; z-index: 1025; background: var(--primary-color); color: white; border: none; padding: 10px 15px; border-radius: 5px; cursor: pointer; }

.doc-section { margin-bottom: 60px; padding: 40px; background: var(--bg-light); border-radius: 15px; box-shadow: 0 5px 15px rgba(0,0,0,0.08); scroll-margin-top: 20px; }
.doc-section h2 { color: var(--primary-color); font-size: 2.2rem; font-weight: 700; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 3px solid var(--secondary-color); display: flex; align-items: center; transition: color 0.3s ease; }
.doc-section h2 i { margin-right: 15px; color: var(--secondary-color); }
.doc-section h3 { color: var(--secondary-color); font-size: 1.5rem; font-weight: 600; margin: 30px 0 20px 0; transition: color 0.3s ease; }
.doc-section h4 { color: var(--text-dark); font-size: 1.2rem; font-weight: 600; margin: 25px 0 15px 0; transition: color 0.3s ease; }

.code-block { background: var(--code-bg); color: var(--code-text); padding: 20px; border-radius: 10px; font-family: 'Courier New', monospace; font-size: 14px; overflow-x: auto; margin: 20px 0; border-left: 4px solid var(--secondary-color); transition: background-color 0.3s ease, color 0.3s ease; }
.code-block .comment { color: #a0aec0; font-style: italic; }
.code-block .keyword { color: #63b3ed; }
.code-block .string { color: #68d391; }

#features .row { margin: 30px 0; }
#features [class*="col-"] { display: flex; margin-bottom: 20px; }

.search-bar-container { position: sticky; top: 20px; z-index: 1020; margin-bottom: 30px; }
.search-input { width: 100%; padding: 15px 20px 15px 45px; border-radius: 30px; border: 1px solid var(--border-color); background-color: var(--bg-light); color: var(--text-dark); font-size: 1rem; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); }
.search-input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 4px 20px rgba(0, 123, 255, 0.2); }
.search-icon { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

.feature-card { background: var(--card-bg); padding: 25px; border-radius: 12px; box-shadow: 0 4px 12px var(--shadow); transition: transform 0.3s ease, box-shadow 0.3s ease; border-left: 4px solid var(--secondary-color); color: var(--text-dark); width: 100%; position: relative; overflow: hidden; height: 100%; }
.feature-number { position: absolute; top: 15px; right: 20px; font-size: 2rem; font-weight: bold; color: var(--secondary-color); opacity: 0.2; font-family: 'Courier New', monospace; }
.feature-card:hover { transform: translateY(-5px); box-shadow: 0 8px 25px var(--shadow-hover); }
.feature-card h4 { color: var(--primary-color); margin-bottom: 15px; display: flex; align-items: center; }
.feature-card h4 i { margin-right: 10px; color: var(--secondary-color); }

.tree-structure { background: var(--card-bg); padding: 25px; border-radius: 10px; font-family: 'Courier New', monospace; font-size: 14px; line-height: 1.4; border: 1px solid var(--border-color); color: var(--text-dark); transition: background-color 0.3s ease, border-color 0.3s ease; }
.tree-item { margin-left: 20px; position: relative; }
.tree-item::before { content: "├── "; color: var(--secondary-color); }
.tree-item:last-child::before { content: "└── "; }
.tree-directory { color: var(--accent-color); font-weight: bold; }
.tree-file { color: var(--text-dark); }

.mobile-toggle { position: fixed; top: 10px; left: 10px; z-index: 1025; background: var(--secondary-color); color: white; border: none; padding: 10px 15px; border-radius: 8px; cursor: pointer; display: none; transition: all 0.3s ease; box-shadow: 0 4px 6px var(--shadow); }
.mobile-toggle:hover { background: var(--primary-color); transform: translateY(-2px); box-shadow: 0 6px 12px var(--shadow-hover); }

.sidebar-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000; display: none; opacity: 0; transition: opacity 0.3s ease; }
.sidebar-overlay.active { display: block; opacity: 1; }

@media (max-width: 768px) {
    .mobile-toggle { display: block; }
    .sidebar { transform: translateX(-100%); width: 280px; z-index: 1051; transition: transform 0.3s ease; }
    .sidebar.active { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 20px; padding-right: 5px; }
    .doc-section { padding: 25px; }
    #features .row { margin: 20px 0; }
    .theme-toggle { top: 10px; right: 10px; }
}

.scroll-top { position: fixed; bottom: 30px; right: 15px; width: 50px; height: 50px; background: var(--primary-color); color: white; border: none; border-radius: 50%; cursor: pointer; opacity: 0; visibility: hidden; transition: all 0.3s ease; z-index: 1000; box-shadow: 0 4px 6px var(--shadow); }
.scroll-top:hover { background: var(--primary-color); transform: translateY(-2px); box-shadow: 0 6px 12px var(--shadow-hover); }
.scroll-top.visible { opacity: 1; visibility: visible; }
.scroll-top:hover { background: var(--primary-color); transform: translateY(-3px); }

[data-theme="dark"] .card { background-color: var(--card-bg); border-color: var(--border-color); color: var(--text-dark); }
[data-theme="dark"] .card-header { background-color: var(--code-bg); border-color: var(--border-color); color: var(--text-dark); }
[data-theme="dark"] .table { --bs-table-bg: var(--card-bg); --bs-table-color: var(--text-dark); --bs-table-border-color: var(--border-color); }
[data-theme="dark"] .btn-outline-primary { border-color: var(--secondary-color); color: var(--secondary-color); }
[data-theme="dark"] .btn-outline-primary:hover { background-color: var(--secondary-color); border-color: var(--secondary-color); color: white; }
html { scroll-behavior: smooth; }
.fade-in { animation: fadeIn 0.6s ease-in; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.avatar { z-index: 1100; width: 150px; height: 150px; box-sizing: border-box; border: 5px white solid; border-radius: 50%; overflow: hidden; box-shadow: 0 5px 15px 0px rgba(0, 0, 0, 0.6); transform: translatey(0px); animation: float 6s ease-in-out infinite; }
@keyframes float { 0% { box-shadow: 0 5px 15px 0px rgba(0, 0, 0, 0.6); transform: translatey(0px); } 50% { box-shadow: 0 25px 15px 0px rgba(0, 0, 0, 0.2); transform: translatey(-20px); } 100% { box-shadow: 0 5px 15px 0px rgba(0, 0, 0, 0.6); transform: translatey(0px); } }
img { width: 100%; height: auto; }