/* --- Global Styles --- */
body {
    font-family: sans-serif;
    background-image: url("https://i.ytimg.com/vi/Cc_9OPJfcgw/maxresdefault.jpg");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: #e0e0e0;
    padding: 20px;
    margin-top: 70px; /* Pushes content down so fixed nav doesn't cover it */
}

/* --- Fixed Navigation --- */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(30, 30, 30, 0.95);
    padding: 15px 20px;
    z-index: 1000;
    border-bottom: 1px solid #444;
    box-sizing: border-box;
}

nav a {
    color: #28a745;
    text-decoration: none;
    font-weight: bold;
    margin-right: 20px;
    font-size: 18px;
}

/* --- Cards & Layout --- */
.card {
    background: rgba(45, 45, 45, .95);
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 10px;
    border: 1px solid #444;
	scroll-margin-top: 60px;
}

.page-wrapper {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

#toc-container {
    width: 250px;
    position: sticky;
    top: 90px;
    max-height: 80vh;
    overflow-y: auto;
}

/* Ensure links are always readable, regardless of visit status */
.card a {
    color: #4da6ff; /* A bright light-blue that pops against dark backgrounds */
    text-decoration: underline;
}

.card a:visited {
    color: #4da6ff; /* Keeps them blue even after you've clicked them */
}

.card a:hover {
    color: #ffffff; /* Turns white when you hover over them */
}

#campaignList { flex-grow: 1; }

/* --- Timer & UI Elements --- */
.timer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.timer-card { background: #333; padding: 10px; border-radius: 8px; border: 1px solid #555; position: relative; }

input, select { padding: 8px; margin: 5px; background: #444; color: white; border: none; width: 200px; }
button { padding: 10px; background: #28a745; color: white; border: none; cursor: pointer; }

#lifetimeStats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
#lifetimeStats div { background: #333; padding: 8px; border-radius: 5px; font-size: 14px; }

.close-btn { background: #a72828; color: white; border: none; cursor: pointer; font-size: 12px; padding: 2px 8px; border-radius: 4px; position: absolute; top: 10px; right: 10px; }

.progress-container { width: 100%; background: #111; border-radius: 5px; height: 25px; margin: 10px 0; position: relative; border: 1px solid #444; }
.progress-bar { height: 100%; background: #28a745; width: 0%; border-radius: 4px; transition: width 1s linear; }

/* --- Table of Contents --- */
html { scroll-behavior: smooth; }
#toc { list-style-type: none; padding: 0; }
#toc a { color: #28a745; text-decoration: none; font-size: 16px; }
#toc a:hover { text-decoration: underline; }

.toast {
    visibility: hidden; /* Remains hidden */
    opacity: 0;         /* Fully transparent */
    transition: opacity 0.5s, visibility 0.5s;
    
    /* Formatting */
    min-width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 5px;
    padding: 16px;
    position: fixed;
    z-index: 1001;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
}

.toast.show {
    visibility: visible;
    opacity: 1;
}

@keyframes fadein {
    from {bottom: 0; opacity: 0;} 
    to {bottom: 30px; opacity: 1;}
}

@keyframes fadeout {
    from {bottom: 30px; opacity: 1;} 
    to {bottom: 0; opacity: 0;}
}