@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    line-height: 1.8;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
}

.main-container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    background-color: var(--container-bg-color);
    padding: 24px 20px 32px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Headings */
h1, h2, h3 {
    font-family: 'Roboto', sans-serif;
    color: var(--heading-color);
    margin-bottom: 20px;
}

h1 {
    font-size: 2.5em;
}

h2 {
    font-size: 2em;
}

h3 {
    font-size: 1.5em;
    margin-top: 30px;
}

p {
    margin-bottom: 20px;
}

a {
    color: var(--link-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.social-link svg {
    width: 20px;
    height: 20px;
}

ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

nav {
    margin-bottom: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
}

nav a {
    margin-right: 0;
    font-size: 1.1em;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

#themeToggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--button-border-color);
    background: var(--button-bg);
    color: var(--button-text-color);
    font-size: 0.95em;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

#themeToggle:hover {
    background: var(--button-bg-hover);
}

#themeToggle svg {
    display: block;
    width: 18px;
    height: 18px;
}

button.toggle-mode {
    background: none;
    border: 1px solid var(--button-border-color);
    color: var(--button-text-color);
    padding: 5px 10px;
    cursor: pointer;
    font-family: 'Roboto', sans-serif;
}

button.toggle-mode:hover {
    background-color: var(--button-hover-bg-color);
}

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

th, td {
    padding: 12px 10px;
    text-align: left;
}

th {
    font-weight: 700;
}

tr:nth-child(even) td {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.03);
}

main {
    width: 100%;
    overflow-x: auto;
}

main table {
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

/* Light Mode Variables */
:root {
    --bg-color: #ffffff;
    --text-color: #222222;
    --heading-color: #111111;
    --link-color: #007acc;
    --container-bg-color: #ffffff;
    --button-border-color: #007acc;
    --button-text-color: #007acc;
    --button-hover-bg-color: #e0e0e0;
    --button-bg: #f6f8fa;
    --button-bg-hover: #e8edf3;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --heading-color: #ffffff;
    --link-color: #bb86fc;
    --container-bg-color: #1e1e1e;
    --button-border-color: #bb86fc;
    --button-text-color: #bb86fc;
    --button-hover-bg-color: #333333;
    --button-bg: #1f2937;
    --button-bg-hover: #243044;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-container {
        padding: 18px 14px 24px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    body {
        font-size: 0.95rem;
    }

    nav a {
        font-size: 1rem;
    }

    .button-container {
        flex-direction: column;
    }

    .button {
        width: 100%;
        margin: 10px 0;
    }

    pre code {
        padding: 10px;
    }
}

@media (max-width: 640px) {
    .main-container {
        padding: 14px 12px 20px;
        box-shadow: 0 0 6px rgba(0, 0, 0, 0.08);
    }

    nav {
        gap: 8px 12px;
    }

    button#themeToggle,
    nav a {
        padding: 4px 0;
    }
}
