/* Reset and Base Styles */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    color: #212529;
    line-height: 1.6;
    font-size: 16px;
    display: flex;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    font-weight: 600;
    line-height: 1.2;
    margin-top: 0;
    color: #1a1a1a;
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
    color: #495057;
}

a {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #0052a3;
    text-decoration: underline;
}

/* Sidebar Navigation */
.sidebar {
    width: 280px;
    background-color: #ffffff;
    border-right: 1px solid #dee2e6;
    padding: 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 100;
    box-shadow: 2px 0 4px rgba(0,0,0,0.02);
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
    position: relative;
}

.sidebar-header h1 {
    font-size: 1.25rem;
    margin: 0 0 1rem 0;
    color: #1a1a1a;
    font-weight: 700;
}

.search-container {
    margin-top: 1rem;
    position: relative;
}

.search-box {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-box:focus {
    outline: none;
    border-color: #0066cc;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.search-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 200;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f3f5;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background-color: #f8f9fa;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1a1a1a;
    margin-bottom: 0.25rem;
}

.search-result-path {
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.search-result-snippet {
    font-size: 0.85rem;
    color: #495057;
    line-height: 1.4;
}

.search-result-highlight {
    background-color: #fff3cd;
    padding: 0 2px;
    font-weight: 600;
}

.search-no-results {
    padding: 1.5rem;
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    padding: 0.5rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.nav-menu {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.nav-menu li {
    margin: 0;
}

.nav-menu a {
    display: block;
    padding: 0.75rem 1.25rem;
    color: #495057;
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}

.nav-menu a:hover {
    background-color: #f8f9fa;
    color: #0066cc;
    text-decoration: none;
    border-left-color: #0066cc;
}

.nav-menu a.active {
    background-color: #e7f3ff;
    color: #0066cc;
    border-left-color: #0066cc;
    font-weight: 600;
}

.nav-menu a.active:hover {
    background-color: #d4ebff;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 280px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-wrapper {
    flex: 1;
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

/* Header */
header {
    background-color: #ffffff;
    border-bottom: 1px solid #dee2e6;
    padding: 0;
    margin: 0;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

header .page-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #dee2e6;
}

header h1 {
    margin: 0;
    color: #1a1a1a;
    font-size: 2rem;
    font-weight: 700;
}

/* Cards */
.card {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.row {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Lists */
ol, ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

ol li {
    margin: 1rem 0;
    padding-left: 0.5rem;
    color: #495057;
}

ul li {
    margin: 0.5rem 0;
    color: #495057;
}

ol li strong, ul li strong {
    color: #1a1a1a;
    font-weight: 600;
}

/* Screenshots */
.screenshot {
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 1.5rem 0;
    cursor: pointer;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.screenshot:hover {
    border-color: #adb5bd;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* Video Container */
.video-container {
    margin: 2rem 0;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.video-container h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.video-container iframe {
    width: 100%;
    max-width: 100%;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    aspect-ratio: 16/9;
    height: auto;
}

.video-note {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #6c757d;
    font-style: italic;
    padding: 0.75rem;
    background-color: #ffffff;
    border-left: 3px solid #ffc107;
    border-radius: 4px;
}

/* Code Blocks */
code {
    background-color: #f1f3f5;
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.9em;
    color: #e83e8c;
}

pre {
    background-color: #1e1e1e;
    color: #d4d4d4;
    padding: 1.25rem;
    border-radius: 6px;
    overflow-x: auto;
    border: 1px solid #343a40;
    margin: 1.5rem 0;
    line-height: 1.5;
}

pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
    font-size: 0.9em;
}

/* Footer */
footer {
    background-color: #ffffff;
    border-top: 1px solid #dee2e6;
    margin-top: 4rem;
    padding: 2rem;
    text-align: center;
    color: #6c757d;
    font-size: 0.875rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.95);
    backdrop-filter: blur(4px);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 95%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    line-height: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(0,0,0,0.5);
}

.close:hover,
.close:focus {
    color: #ffffff;
    background-color: rgba(0,0,0,0.7);
    text-decoration: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        font-size: 15px;
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
        max-height: 300px;
    }
    
    .sidebar-header {
        padding: 1rem;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-wrapper {
        padding: 1rem;
    }
    
    header .page-header {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    .video-container {
        padding: 1rem;
    }
    
    .close {
        top: 10px;
        right: 20px;
        font-size: 30px;
        width: 32px;
        height: 32px;
    }
}

/* Utility Classes */
.text-muted {
    color: #6c757d;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
