/* 1. Define the Variable "Palettes" */
:root {
    --bg-image: url("../img/green_wave_backg.png");
    --bg-color: #bebebe;
    --nav-bg: lightgrey;
    --text-color: #000000;
    --nav-link-color: white;
    --card-shadow: rgba(0,0,0,0.1);
    --base-font-size: 100%;
}

body.theme-dark {
    --bg-image: url("../img/green_wave_backg.png");
    --bg-color: #1a1a1a;
    --nav-bg: #333333;
    --text-color: #f4f4f4;
    --nav-link-color: #00FF23;
    --card-shadow: rgba(0,0,0,0.5);
}

/* 2. Apply the Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Basic", sans-serif;
}

html {
    /* This allows our font-size cookie to scale everything */
    font-size: var(--base-font-size);
}

body {
    background: var(--bg-image) no-repeat center;
    background-color: var(--bg-color);
    background-size: cover;
    background-attachment: fixed;
    color: var(--text-color);
    transition: background 0.3s ease, color 0.3s ease;
    min-height: 100vh;
}

.navbar {
    display: flex;
    font-weight: bold;
    justify-content: space-around;
    margin: auto;
    padding: 20px 15px;
    width: 80%;
    text-decoration: none;
    font-size: 1.5rem;
    background: var(--nav-bg);
    box-shadow: 0 4px 10px var(--card-shadow);
    border-radius: 15px;
}

.navbar h2 { font-size: 1.1rem; text-align: center; }

.navbar a {
    text-align: center;
    text-decoration: none;
    color: var(--nav-link-color);
    font-size: 1.8rem !important;
    text-shadow: black 3px 3px 4px;
}

.navbar a:hover { text-decoration: underline; }

.navbar a.active {
    text-decoration: underline;
    color: var(--nav-link-color);
}

/* UI Elements */
::placeholder { color: #008F14; opacity: 0.5; }
#home { text-shadow: #00E01F 3px 3px 4px; }
#logout { text-shadow: #990000 3px 3px 4px; }

/* Simple fix for the toggle button specifically */
.theme-toggle-btn {
    cursor: pointer;
    border: 1px solid var(--text-color);
    padding: 5px 10px;
    border-radius: 5px;
    background: transparent;
    color: var(--text-color);
}

/* Table Styling */
table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--card-bg); /* Uses the solid color we defined */
    color: var(--text-color);
    margin: 20px 0;
    border-radius: 12px;
    overflow: hidden; /* Keeps the rounded corners tidy */
    box-shadow: 0 4px 15px var(--card-shadow);
}

th {
    background-color: #00FF23; /* GGC Green for headers */
    color: black;
    padding: 15px;
    text-align: left;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(0,0,0,0.1); /* Subtle divider */
}

/* Zebra striping for readability */
tr:nth-child(even) {
    background-color: rgba(0,0,0,0.03); 
}

/* Hover effect so users can track rows */
tr:hover {
    background-color: rgba(0,255,35,0.1);
}

/* Dark mode specific tweak for row borders */
body.theme-dark td {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* Modal Background (Hidden by default) */
.modal-overlay {
    display: none; 
    position: fixed;
    z-index: 9999; /* Stay on top of everything */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6); /* Dim the background */
    backdrop-filter: blur(3px);
}

/* The Settings Box */
.modal-content {
    background-color: var(--nav-bg);
    color: var(--text-color);
    margin: 10% auto;
    padding: 30px;
    border-radius: 15px;
    width: 350px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    position: relative;
}

.close-btn {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 28px;
    cursor: pointer;
}

.setting-item { margin: 20px 0; }
.btn-toggle {
    padding: 10px;
    background: #00FF23;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}