:root {
    --primary-bg: #1a1a2e;
    --secondary-bg: #16213e;
    --card-border: #0f3460;
    --primary-text: #e94560;
    --secondary-text: #dcdcdc;
    --hover-glow: #e94560;
    --code-text: #a9ffb0;
    --table-header-bg: #0f3460;
}

body.light-mode {
    --primary-bg: #f4f7fc;
    --secondary-bg: #ffffff;
    --card-border: #dbe2ef;
    --primary-text: #3f72af;
    --secondary-text: #112d4e;
    --hover-glow: #3f72af;
    --code-text: #d63384;
    --table-header-bg: #dbe2ef;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: var(--primary-bg);
    color: var(--secondary-text);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
    box-sizing: border-box;
}

*, *:before, *:after {
    box-sizing: inherit;
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
}

header {
    position: relative;
    text-align: center;
    margin-bottom: 40px;
}

footer {
    text-align: center;
    margin-bottom: 40px;
}

h1, h2, h3 {
    color: var(--primary-text);
    margin-top: 0;
}

h3 {
    margin-top: 30px;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

p.subtitle {
    font-size: 1.2em;
    color: var(--secondary-text);
    max-width: 600px;
    margin: 0 auto;
}

a {
    color: var(--primary-text);
    text-decoration: none;
}

img,
video {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    margin-left: auto;
    margin-right: auto;
}

.hub-container {
    text-align: center;
}

.nav-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 50px;
}

.nav-button {
    background-color: var(--secondary-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 25px;
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s;
}

.nav-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2), 0 0 15px var(--hover-glow);
}

.nav-button .icon {
    font-size: 2.5em;
}

.nav-button h2 {
    margin: 10px 0;
    font-size: 1.5em;
}

.nav-button p {
    font-size: 1em;
    line-height: 1.5;
    margin: 0;
    color: var(--secondary-text);
}

.content-page {
    background-color: var(--secondary-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 30px 40px;
    transition: background-color 0.3s, border-color 0.3s;
}

.content-page h1 {
    text-align: center;
    border-bottom: 2px solid var(--card-border);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.content-page h2 {
    font-size: 1.8em;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 10px;
    margin-top: 40px;
}

.content-page p, .content-page li {
    line-height: 1.7;
    font-size: 1.1em;
}

.content-page .back-link {
    display: inline-block;
    margin-bottom: 20px;
    font-weight: bold;
}

.table-container {
    overflow-x: auto;
    margin-top: 20px;
    border: 1px solid var(--card-border);
    border-radius: 5px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--card-border);
}

table tr:last-child td {
    border-bottom: none;
}

th {
    background-color: var(--table-header-bg);
    color: var(--secondary-text);
    transition: background-color 0.3s;
}

pre {
    background-color: var(--primary-bg);
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    border: 1px solid var(--card-border);
    transition: background-color 0.3s;
}

code {
    font-family: 'Courier New', Courier, monospace;
    color: var(--code-text);
}

#theme-switcher {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 50px;
    height: 50px;
    background-color: var(--secondary-bg);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    overflow: hidden;
    transition: background-color 0.3s;
}

#theme-switcher .sun-icon, #theme-switcher .moon-icon {
    transition: opacity 0.3s ease;
}

body.light-mode #theme-switcher .sun-icon {
    display: none;
}

body:not(.light-mode) #theme-switcher .moon-icon {
    display: none;
}

.image-container {
    margin-top: 15px;
    padding: 10px;
    border: 2px dashed var(--card-border);
    text-align: center;
    border-radius: 15px;
}

.image-container p {
    margin: 0;
    color: var(--secondary-text);
    opacity: 0.7;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    .container {
        padding: 5px;
    }
    h1 {
        font-size: 2em;
    }
    .content-page {
        padding: 20px 15px;
    }
    .content-page h1 {
        font-size: 1.8em;
    }
    .content-page h2 {
        font-size: 1.5em;
    }
    #theme-switcher {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}