/* Modern, Clean Minimalist Theme */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f9f9f9;
}
header {
    text-align: center;
    padding: 40px 0;
    border-bottom: 2px solid #eaeaea;
}
h1 { margin-bottom: 5px; color: #1a1a1a; }

.tagline {
    font-size: 1.2rem;
    color: #666;
    font-style: italic;
    margin-top: 5px;
}

/* --- Knowledge Test Button --- */
.btn-knowledge-test {
    display: inline-block;
    background-color: #28a745;
    color: white;
    padding: 10px 24px;
    font-size: 1.1rem;
    font-weight: bold;
    text-decoration: none;
    border-radius: 5px;
    margin: 10px 0;
    transition: background 0.2s, transform 0.1s;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    white-space: nowrap;
}
.btn-knowledge-test:hover {
    background-color: #218838;
    transform: scale(1.02);
}
.btn-knowledge-test:active {
    transform: scale(0.98);
}

/* --- Knowledge Test Container --- */
.knowledge-test-container {
    background: #f8fff8;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0 25px 0;
    text-align: center;
    border-left: 4px solid #28a745;
}

.content-section { margin: 40px 0; }

/* Centered title modification for the datasets section */
.centered-title {
    text-align: center;
    color: #0077cc;
    border-bottom: 1px solid #eaeaea;
    padding-bottom: 5px;
    margin-top: 30px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Subject subtitle styling matching the blue headers */
.subject-title {
    color: #0077cc;
    margin-top: 10px;
    margin-bottom: 10px;
    font-size: 1.6rem;
    font-weight: bold;
}

/* Global style for category descriptions beneath headers */
.category-description {
    font-size: 1rem;
    color: #555;
    margin-top: 5px;
    margin-bottom: 15px;
}

/* Dashboard Category Buttons -- styled as <a> links so each one opens its
   subject page in a new tab, but visually identical to the old <button> */
.category-dashboard {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin: 25px 0 35px 0;
}
.btn-category {
    display: inline-block;
    flex: 0 0 auto;
    background-color: #fff;
    color: #0077cc;
    border: 2px solid #0077cc;
    padding: 18px 24px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.btn-category:hover {
    background-color: #0077cc;
    color: #fff;
    transform: translateY(-2px);
}

.db-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0 30px 0;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}
.db-table th, .db-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eaeaea;
    font-size: 0.95rem;
}
.db-table th { background-color: #f1f1f1; color: #444; font-weight: bold; }

/* Custom row style for specific dataset pre-descriptions */
.dataset-pre-desc {
    background-color: #fafafa;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    padding: 8px 12px;
    border-bottom: none;
}

.badge-free {
    background-color: #2ecc71;
    color: white;
    padding: 6px 12px;
    font-weight: bold;
    font-size: 0.8rem;
    border-radius: 3px;
    transition: background 0.2s;
    display: inline-block;
}
.badge-free:hover {
    background-color: #27ae60;
}
.source-text {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.2;
}

.brain-headline {
    text-align: center;
    color: #1a1a1a;
    font-size: 1.7rem;
    font-weight: bold;
    margin: 10px 0 0 0;
}

.centered-headline {
    text-align: center;
    color: #0077cc;
    margin: 20px 0;
    font-size: 1.5rem;
    font-weight: bold;
}
.gif-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 25px 0 5px 0;
}

/* Animated brain-head: hue pulse (background grid blue<->purple) + two
   soft traveling light streaks over the existing waveform lines + a
   breathing glow around the frame. Pure CSS, no new image assets. */
.brain-frame {
    position: relative;
    width: 240px;
    height: 240px;
    overflow: hidden;
    border-radius: 6px;
    animation: brainGlow 4s ease-in-out infinite alternate;
}
.brain-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    animation: brainHuePulse 7s ease-in-out infinite alternate;
}
@keyframes brainGlow {
    0%   { box-shadow: 0 0 25px 4px rgba(80,90,255,0.35); }
    100% { box-shadow: 0 0 40px 10px rgba(150,80,255,0.5); }
}
@keyframes brainHuePulse {
    0%   { filter: hue-rotate(0deg) saturate(1); }
    50%  { filter: hue-rotate(-30deg) saturate(1.25); }
    100% { filter: hue-rotate(0deg) saturate(1); }
}
.brain-sweep {
    position: absolute;
    left: -60%;
    width: 220%;
    height: 9%;
    filter: blur(5px);
    mix-blend-mode: screen;
    background: linear-gradient(
        100deg,
        transparent 0%,
        transparent 44%,
        rgba(255,255,255,0.65) 49%,
        rgba(255,255,255,0.65) 51%,
        transparent 56%,
        transparent 100%
    );
    background-size: 300% 100%;
    animation: brainTravel 3.4s linear infinite;
}
.brain-sweep.upper { top: 32%; }
.brain-sweep.lower { top: 55%; animation-duration: 4.2s; animation-direction: reverse; }
@keyframes brainTravel {
    0%   { background-position: 100% 0; }
    100% { background-position: -200% 0; }
}

/* Back-to-home link shown at the top of each standalone subject page */
.back-link {
    display: inline-block;
    margin: 20px 0 0 0;
    color: #0077cc;
    font-size: 0.95rem;
    text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

footer {
    text-align: center;
    padding: 40px 0;
    font-size: 0.9rem;
    color: #888;
    border-top: 1px solid #eaeaea;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .knowledge-test-container {
        padding: 12px 15px;
    }
    .btn-knowledge-test {
        font-size: 1rem;
        padding: 8px 16px;
        white-space: normal;
    }
}
