/* --- THEME DEFINITIONS (CSS VARIABLES) --- */
/* Default: Dark Grey Theme */
body[data-theme='dark-grey'] {
    --dark-bg: #0d1117;
    --medium-dark-bg: #161b22;
    --border-color: #30363d;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --accent-red: #da3633;
    --accent-blue: #58a6ff;
    --accent-green: #238636;
}

/* New: Dark Purple Theme */
body[data-theme='dark-purple'] {
    --dark-bg: #1a102c;
    /* Dark purple */
    --medium-dark-bg: #2a1a47;
    --border-color: #4a3a69;
    --text-primary: #e6e0f3;
    --text-secondary: #a094b8;
    --accent-red: #ff7b72;
    /* Lighter red for contrast */
    --accent-blue: #a391f7;
    /* Lavender blue */
    --accent-green: #3ddc84;
    /* Minty green */
}

/* --- Global Styles using Variables --- */
html {
    overflow-y: scroll;
}

body {
    background-color: #0d1117;
    color: var(--text-primary, #c9d1d9);
    margin: 0;
    font-family: 'Roboto', sans-serif;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

.site-header {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color, #30363d);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    margin: 0;
    padding: 0;
}

.logo a {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #f0f0f0;
    text-decoration: none;
    display: inline-block;
    margin: 0;
    padding: 0;
}

.logo .logo-key {
    color: var(--accent-red, #da3633);
}

.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color, #30363d);
    padding: 1.5rem 0;
    color: var(--text-secondary, #8b949e);
    font-size: 0.9rem;
    text-align: center;
}

/* --- Header Navigation Buttons --- */
.header-nav {
    display: flex;
    gap: 1rem;
}

/* Use a more specific selector to ensure styles apply correctly */
.header-nav .nav-button {
    color: var(--text-primary, #c9d1d9);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid var(--accent-red, #da3633);
    /* Red border by default */
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
    font-weight: 500;
    font-size: 0.9rem;
    background-color: transparent;
}

.header-nav .nav-button:hover {
    background-color: var(--accent-red, #da3633);
    color: #ffffff;
    border-color: var(--accent-red, #da3633);
}

/* Flashed Messages */
.messages {
    padding: 0;
    margin: 0 auto 1.5rem auto;
    max-width: 800px;
    list-style: none;
    transition: opacity 0.5s ease-in-out;
}

.messages ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.messages li {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 6px;
    border: 1px solid transparent;
    font-weight: 500;
}

.messages li.success {
    background-color: rgba(35, 134, 54, 0.2);
    border-color: rgba(56, 139, 253, 0.3);
    color: var(--accent-green, #3fb950);
}

.messages li.danger {
    background-color: rgba(218, 54, 51, 0.15);
    border-color: rgba(248, 81, 73, 0.4);
    color: var(--accent-red, #da3633);
}

.messages li.info {
    background-color: rgba(88, 166, 255, 0.15);
    border-color: rgba(88, 166, 255, 0.4);
    color: var(--accent-blue, #58a6ff);
}