:root {
    --bg-color: white;
    --text-color: black;
    --sidebar-color: #eee;
    --footer-bg: #f0f0f0;
    --logo-height: 40px;
    --link-color: #0077cc;
    --button-bg: white;
    --button-text: black;
    --button-border: black;
    --card-bg: #ffffff;
    --card-text: #000000;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1e1e1e;
        --text-color: #e0e0e0;
        --sidebar-color: #2c2c2c;
        --footer-bg: #2a2a2a;
        --link-color: #66aaff;
        --button-bg: #333;
        --button-text: white;
        --button-border: #aaa;
        --card-bg: #2a2a2a;
        --card-text: #e0e0e0;
    }
}

[data-theme="light"] {
    --bg-color: white;
    --text-color: black;
    --sidebar-color: #fffdfd;
    --footer-bg: #f0f0f0;
    --link-color: #0077cc;
    --button-bg: white;
    --button-text: black;
    --button-border: black;
    --card-bg: #ffffff;
    --card-text: #000000;
}

[data-theme="green"] {
    --bg-color: #f0fff0;
    --text-color: #004d00;
    --sidebar-color: #e1ece1;
    --footer-bg: #c8e6c9;
    --link-color: #228b22;
    --button-bg: #ccffcc;
    --button-text: #004d00;
    --button-border: #009900;
}

[data-theme="dark"] {
    --bg-color: #1e1e1e;
    --text-color: #e0e0e0;
    --sidebar-color: #3a3a3a;
    --footer-bg: #2a2a2a;
    --link-color: #66aaff;
    --button-bg: #333;
    --button-text: white;
    --button-border: #aaa;
}

[data-theme="blue"] {
    --bg-color: #eef6fb;
    --text-color: #003366;
    --sidebar-color: #f0f8ff;
    --footer-bg: #cde6f7;
    --link-color: #007acc;
    --button-bg: #cce6ff;
    --button-text: #002244;
    --button-border: #005599;
}

.welcome-banner {
    opacity: 0.75;
}

@keyframes logo-bounce {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(10px);
    }
}

.logo {
    animation: logo-bounce 2s infinite ease-in-out;
    opacity: 0.75;
}

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

a:hover {
    text-decoration: underline;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: sans-serif;
    margin: 0;
    height: 100%;
}

html,
body {
    margin: 10;
    padding: 10;
    height: 100%;
    font-family: sans-serif;
}

.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#login-area {
    background: #f0f0f0;
    padding: 10px 20px;
}

.container {
    display: flex;
    flex: 1;
    /* stretch to fill vertical space between login and footer */
}

#topbar {
    display: flex;
    background-color: var(--bg-color);
    color: var(--text-color);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ccc;
}

#login-area {
    background-color: inherit;
    /* or transparent */
}

#sidebar {
    background-color: var(--sidebar-color);
    width: 170px;
    padding: 20px;
    flex-shrink: 0;
}

#sidebar h2 {
    margin-top: 0;
}

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

#sidebar li {
    margin: 10px 0;
}

#sidebar a.active {
    font-weight: bold;
}

#content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--footer-bg);
    padding: 12px 20px;
    font-size: 0.9em;
}

.footer-left button {
    font-size: 14px;
    padding: 6px 12px;
}

.footer-right p {
    text-decoration: none;
    color: var(--text-color);
}

.logo {
    height: var(--logo-height);
}

.google-login {
    padding: 8px 14px;
    font-size: 14px;
    border: 1px solid var(--button-border);
    background-color: var(--button-bg);
    color: var(--button-text);
    border-radius: 6px;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
}

.google-login:hover {
    background-color: var(--button-text);
    color: var(--button-bg);
}

.youtube-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
    /* adds space between thumbnails */
    margin-top: 20px;
    padding: 10px;
}

.youtube-thumbnails a {
    display: block;
    background: #f9f9f9;
    border: 2px solid #ccc;
    border-radius: 10px;
    padding: 5px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.youtube-thumbnails a:hover {
    border-color: #888;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.youtube-thumbnails img {
    width: 100%;
    border-radius: 6px;
    display: block;
}

.pagination {
    margin: 30px auto 60px auto;
    text-align: center;
    font-size: 18px;
}

.pagination button {
    margin: 0 10px;
    padding: 12px 20px;
    font-size: 18px;
    border-radius: 6px;
    border: 1px solid #aaa;
    background-color: #f0f0f0;
    cursor: pointer;
}

.pagination button:hover {
    background-color: #e0e0e0;
}

.pagination span {
    margin: 0 10px;
    font-weight: bold;
}

.book-download {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.book-download img.icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}


.welcome-banner {
    background-color: var(--footer-bg);
    color: var(--text-color);
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 20px;
    border-radius: 10px;
    font-size: 1.2em;
}

.home-image {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.home-image img {
    max-width: 90%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.board_title {
    width: 100%;
    font-size: 1.2em;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
}

.board_text_input {
    width: 100%;
    font-size: 1em;
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    resize: vertical;
}

.board_list {
    list-style-type: none;
    padding: 0;
}

.board_post {
    background-color: var(--sidebar-color);
    color: var(--text-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.board_post:hover {
    transform: translateY(-2px);
    background-color: rgba(255, 255, 255, 0.05);
    /* subtle overlay */
}

.board_post h3 {
    margin-top: 0;
}

.board_post p {
    font-size: 1.1em;
    line-height: 1.6em;
    color: var(--text-color);
}

.board_meta {
    font-size: 0.9em;
    color: var(--text-color);
    margin-top: 10px;
    font-style: italic;
}

.admin_controls {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.admin_controls button {
    padding: 6px 12px;
    font-size: 0.9em;
    background-color: #c62828;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.admin_controls button:hover {
    background-color: #b71c1c;
}

#topbar {
    position: relative;
    background-color: transparent;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1;
    overflow: hidden;
}

/* Keep content above the overlay */
#topbar > * {
    position: relative;
    z-index: 1;
}

body[data-theme="light"] {
    background: url('/static/backgrounds/korea_default.webp') no-repeat center center fixed;
    background-size: cover;
}
body[data-theme="green"] {
    background: url('/static/backgrounds/korea_auturm.webp') no-repeat center center fixed;
    background-size: cover;
}
body[data-theme="dark"] {
    background: url('/static/backgrounds/korea_night.webp') no-repeat center center fixed;
    background-size: cover;
}
body[data-theme="blue"] {
    background: url('/static/backgrounds/korea_spring.webp') no-repeat center center fixed;
    background-size: cover;
}
