:root {
    --bg-color: #1a1a2e;
    /* Dark Blue */
    --sidebar-bg: #16213e;
    /* Slightly lighter blue */
    --text-color: #e94560;
    /* Pinkish Red accent */
    --text-main: #ecf0f1;
    /* White-ish */
    --text-muted: #bdc3c7;
    --accent: #0f3460;
    --highlight: #e94560;
    --glass: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.1);
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

/* Global Link Styling */
a {
    color: #4cd137;
    /* Bright Green/Cyan for visibility */
    text-decoration: none;
    transition: color 0.2s;
}

a:visited {
    color: #4cd137;
}

a:hover {
    color: var(--highlight);
    text-decoration: underline;
}

/* Layout */
.container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    flex-shrink: 0;
}

.content-frame {
    flex-grow: 1;
    border: none;
    background-color: var(--bg-color);
}

/* Sidebar Elements */
h1.logo {
    font-size: 1.5rem;
    color: var(--highlight);
    margin-bottom: 2rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-align: center;
}

.nav-section {
    margin-bottom: 20px;
}

.nav-header {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

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

.nav-links li {
    margin-bottom: 5px;
}

.nav-links a {
    display: block;
    padding: 8px 12px;
    color: var(--text-main);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.nav-links a:hover {
    background-color: var(--glass);
    color: var(--highlight);
    transform: translateX(5px);
}

/* Content Styling (for pages inside iframe) */
.page-content {
    padding: 40px;
    max-width: 900px;
    margin: 0 auto;
}

h1,
h2,
h3 {
    color: var(--highlight);
    margin-top: 2rem;
}

h1 {
    border-bottom: 2px solid var(--border);
    padding-bottom: 10px;
}

h2 {
    font-size: 1.5rem;
    margin-top: 3rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 5px;
}

h3 {
    font-size: 1.2rem;
    color: #fff;
}

p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

code {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    color: #ff9f43;
}

pre {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid var(--border);
}

pre code {
    background-color: transparent;
    padding: 0;
    color: #f1c40f;
}

.card {
    background-color: var(--glass);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.method-sig {
    font-weight: bold;
    color: #48dbfb;
    margin-bottom: 5px;
}

.tag {
    display: inline-block;
    padding: 2px 8px;
    background-color: var(--accent);
    border-radius: 10px;
    font-size: 0.7rem;
    margin-left: 10px;
    vertical-align: middle;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

th,
td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--highlight);
}

/* Alert Boxes */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 8px;
    background-color: var(--glass);
}

.alert-info {
    color: #d1ecf1;
    background-color: rgba(23, 162, 184, 0.2);
    border-color: rgba(23, 162, 184, 0.3);
}

.alert-warning {
    color: #fff3cd;
    background-color: rgba(255, 193, 7, 0.2);
    border-color: rgba(255, 193, 7, 0.3);
}

.alert-danger {
    color: #f8d7da;
    background-color: rgba(220, 53, 69, 0.2);
    border-color: rgba(220, 53, 69, 0.3);
}

/* Mobile Header (Hidden by default) */
.mobile-header {
    display: none;
    background-color: var(--sidebar-bg);
    padding: 15px 20px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}

.mobile-logo {
    color: var(--highlight);
    font-weight: 700;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.menu-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
}

.desktop-only {
    display: block;
}

/* Responsive Design for Mobile/Tablet */
@media (max-width: 1024px) {
    .container {
        flex-direction: column;
    }

    .desktop-only {
        display: none !important;
    }

    .mobile-header {
        display: flex;
        flex-shrink: 0;
        /* Prevent header from shrinking */
    }

    .sidebar {
        display: none;
        /* Hidden by default */
        width: 100%;
        height: auto;
        max-height: 40vh;
        /* Limit height and allow scroll */
        border-right: none;
        border-bottom: 1px solid var(--border);
        box-sizing: border-box;
        flex-shrink: 0;
        /* Prevent sidebar from shrinking */
    }

    .sidebar.active {
        display: flex;
        /* Show when active */
    }

    .content-frame {
        width: 100%;
        flex-grow: 1;
        /* Take remaining space */
        height: 0;
        /* Important for scrollable iframe in flex container */
        min-height: 0;
    }

    /* Adjust navigation for better touch targets */
    .nav-links {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
        padding: 10px;
        /* Add some padding around the grid */
    }

    .nav-links a {
        padding: 6px 8px;
        /* Slightly more padding for touch */
        font-size: 0.85rem;
        line-height: 1.2;
        text-align: center;
        /* Center text for better balance */
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        /* Fill the grid cell */
    }

    .nav-links li {
        margin-bottom: 0px;
    }
}