:root {
    --primary: #0071e3;
    --text: #1d1d1f;
    --text-secondary: #86868b;
    --bg: #fbfbfd;
    --card-bg: #ffffff;
    --border: #d2d2d7;
    --code-bg: #f5f5f7;
    --success: #34c759;
    --warning: #ff9f0a;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Container */
.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 15px 0;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 600;
    font-size: 18px;
    text-decoration: none;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    margin-left: 20px;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary);
}

/* Hero Section (Landing) */
.hero {
    text-align: center;
    padding: 80px 20px;
}

.hero h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.hero p {
    font-size: 21px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
}

/* Cards Grid */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.card {
    background: var(--card-bg);
    border-radius: 18px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02), 0 10px 15px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
    border: 1px solid transparent;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    border-color: var(--primary);
}

.card-icon {
    font-size: 40px;
    margin-bottom: 20px;
    display: block;
}

.card h3 {
    font-size: 24px;
    margin: 0 0 10px;
    font-weight: 600;
}

.card p {
    color: var(--text-secondary);
    font-size: 15px;
    margin: 0;
}

/* Documentation Content */
.doc-layout {
    display: flex;
    gap: 40px;
    margin-top: 40px;
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
    height: fit-content;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar li {
    margin-bottom: 10px;
}

.sidebar a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    display: block;
    padding: 5px 0;
    transition: color 0.2s;
}

.sidebar a:hover,
.sidebar a.active {
    color: var(--primary);
    font-weight: 500;
}

.content {
    flex: 1;
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.content h1 {
    font-size: 36px;
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}

.content h2 {
    font-size: 24px;
    margin-top: 40px;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.content h3 {
    font-size: 18px;
    margin-top: 30px;
    margin-bottom: 10px;
    font-weight: 600;
}

.content p {
    color: #333;
    margin-bottom: 16px;
    font-size: 16px;
    line-height: 1.6;
}

.content ul {
    margin-bottom: 20px;
}

.content li {
    margin-bottom: 8px;
}

/* Code Blocks */
pre {
    background: var(--code-bg);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: "SF Mono", Monaco, Consolas, monospace;
    font-size: 13px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

code {
    font-family: "SF Mono", Monaco, Consolas, monospace;
    background: var(--code-bg);
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.9em;
    color: #e03e3e;
}

pre code {
    color: var(--text);
    padding: 0;
    background: transparent;
}

.note {
    background: #f0f6fc;
    border-left: 4px solid var(--primary);
    padding: 15px;
    border-radius: 4px;
    margin: 20px 0;
    font-size: 15px;
}


/* Lightbox / Zoom Premium */
.doc-image {
    cursor: zoom-in;
    transition: transform 0.2s;
}

.doc-image:hover {
    transform: scale(1.02);
}

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lightbox-overlay.active .lightbox-img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* =========================================
   DEVELOPER THEME (Dark Mode)
   ========================================= */
body.dev-theme {
    --bg: #0d1117;
    --text: #ffffff;
    /* Pure white for maximum readability */
    --text-secondary: #d0d7de;
    /* Lighter secondary text */
    --card-bg: #161b22;
    --border: #30363d;
    --code-bg: #0d1117;
    --primary: #58a6ff;
}

body.dev-theme p,
body.dev-theme li {
    color: var(--text) !important;
    /* Force white text */
}

body.dev-theme header {
    background: rgba(13, 17, 23, 0.95);
    border-bottom: 1px solid var(--border);
}

body.dev-theme .logo {
    color: #f0f6fc;
}

body.dev-theme .content {
    background: var(--card-bg);
    border: 1px solid var(--border);
    box-shadow: none;
}

body.dev-theme .content h1,
body.dev-theme .content h2,
body.dev-theme .content h3 {
    color: #f0f6fc;
}

body.dev-theme .content h2 {
    border-bottom-color: var(--border);
}

body.dev-theme pre {
    background: #0d1117;
    border: 1px solid var(--border);
}

body.dev-theme code {
    background: rgba(110, 118, 129, 0.4);
    color: #ff7b72;
}

body.dev-theme .note {
    background: rgba(56, 139, 253, 0.15);
    border-left-color: #58a6ff;
    color: #e6edf3;
}

body.dev-theme .sidebar a:hover,
body.dev-theme .sidebar a.active {
    color: #58a6ff;
}

body.dev-theme .table th {
    background: #161b22;
    border-bottom: 2px solid var(--border);
    color: #f0f6fc;
}

body.dev-theme .table td {
    border-bottom: 1px solid var(--border);
}

/* Developer Table Semantics */
body.dev-theme .col-name {
    color: #79c0ff;
    /* Soft Blue */
    font-family: monospace;
}

body.dev-theme .col-type {
    color: #ff7b72;
    /* Soft Red */
    font-family: monospace;
    font-size: 0.9em;
}

body.dev-theme .col-desc {
    color: #ffffff;
    /* Pure white for description */
    line-height: 1.6;
}

/* Theme Toggle Button */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border);
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    margin-left: auto;
    /* Push to right */
    font-weight: 500;
}

.theme-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

body.dev-theme .theme-toggle {
    background: #21262d;
    border-color: #30363d;
    color: #c9d1d9;
}

body.dev-theme .theme-toggle:hover {
    border-color: #8b949e;
    color: #fff;
    background: #30363d;
}