/* ==========================
   CSS VARIABLES FOR THEMES
   ========================== */
:root {
    --bg-color: #ffffff;
    --text-color: rgb(0, 152, 210);
    --container-bg: #ffffff;
    --container-shadow: rgba(0,0,0,0.1);
    --button-bg: rgb(0, 152, 210);
    --button-hover: rgb(0, 144, 205, 0.807);
    --footer-bg: rgba(255, 255, 255, 0.7);
    --footer-link: rgb(0, 152, 210);
}

[data-theme="dark"] {
    --bg-color: #1e1e1e;
    --text-color: #9696ff;
    --container-bg: #2a2a2a;
    --container-shadow: rgba(0,0,0,0.5);
    --button-bg: #444444;
    --button-hover: #666666;
    --footer-bg: rgba(30, 30, 30, 0.7);
    --footer-link: #9696ff;
}

/* ==========================
   GENERAL STYLES
   ========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: Arial, sans-serif;
    text-align: center;
    transition: background-color 0.3s, color 0.3s;
    padding: 40px 20px;
}

/* ==========================
   TOP BUTTON BAR
   ========================== */
.top-buttons {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 20px;
    background-color: var(--footer-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px var(--container-shadow);
    z-index: 1000;
}

/* Back button */
.top-buttons a {
    padding: 8px 16px;
    font-size: 1rem;
    background-color: var(--button-bg);
    color: white;
    border: none;
    border-radius: 0; /* square button */
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.top-buttons a:hover {
    background-color: var(--button-hover);
    transform: scale(1.05);
}

/* ==========================
   SWITCH STYLING
   ========================== */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;  /* width of the switch */
    height: 28px; /* height of the switch */
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0;
    right: 0; bottom: 0;
    background-color: var(--button-bg);
    border-radius: 14px; /* rounded pill shape */
    transition: background-color 0.3s;
}

.slider::before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%; /* circle knob */
    transition: transform 0.2s;
}

/* Checked = switch ON */
.switch input:checked + .slider {
    background-color: var(--button-hover);
}

.switch input:checked + .slider::before {
    transform: translateX(32px);
}

/* ==========================
   CONTAINER
   ========================== */
.container {
    max-width: 800px;
    margin: 80px auto 0; /* add top margin to avoid overlap with top bar */
    padding: 30px 20px;
    background-color: var(--container-bg);
    border-radius: 10px;
    box-shadow: 0 4px 10px var(--container-shadow);
    transition: background-color 0.3s, box-shadow 0.3s;
    text-align: left;
}

.container h1, .container h2, .container h3 {
    text-align: center;
    margin: 20px 0 10px;
}

.container p {
    margin: 10px 0;
    line-height: 1.6;
}

.container ul {
    margin: 10px 0 20px 20px;
}

.container li {
    margin: 5px 0;
}

/* ==========================
   LINKS
   ========================== */
a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: bold;
}

a:hover {
    text-decoration: underline;
}

/* ==========================
   FOOTER
   ========================== */
/* ==========================
   FOOTER
   ========================== */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;                  /* use flexbox */
    justify-content: center;        /* center the items */
    align-items: center;            /* vertically center them */
    gap: 20px;                      /* spacing between links */
    padding: 10px 20px;
    font-size: 0.9rem;
    background-color: var(--footer-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 -2px 10px var(--container-shadow);
    white-space: nowrap;            /* prevent wrapping */
    overflow-x: auto;               /* allow horizontal scroll if really needed */
}

footer a {
    color: var(--footer-link);
    text-decoration: none;
    font-weight: bold;
    flex-shrink: 0;                 /* prevents shrinking */
}

footer a:hover {
    text-decoration: underline;
}
