/* Color Palette Variables */
:root {
    --bg-primary: #e5f6fa;
    --text-primary: #152a31;
    --text-secondary: #274a4d;
    --accent: #471314;
    --border-main: #152a31;
    --border-light: #59777a;
    --bg-secondary: #b5d3d9;
    --btn-bg: #e5f6fa;
    --btn-hover: #b5d3d9;
    --code-bg: #b5d3d9;
    --error-bg: #471314;
    --error-text: #e5f6fa;
}

[data-theme="dark"] {
    --bg-primary: #152a31;
    --text-primary: #e5f6fa;
    --text-secondary: #b5d3d9;
    --accent: #84aeae; 
    --border-main: #84aeae;
    --border-light: #59777a;
    --bg-secondary: #274a4d;
    --btn-bg: #152a31;
    --btn-hover: #274a4d;
    --code-bg: #274a4d;
    --error-bg: #471314;
    --error-text: #e5f6fa;
}

/* Base text styles */
body {
    color: var(--text-primary);
    background-color: var(--bg-primary);
    font-family: 'Barlow', Helvetica, Arial, sans-serif;
    font-size: 20px;
    line-height: 27px;
    font-weight: 400;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s, color 0.3s;
}

/* Typography Overrides for Titles and Buttons */
#title-l1, 
#title-l2, 
h1, 
h2, 
h3, 
.header, 
.coming-soon-title, 
button.nav-btn {
    font-family: 'Iosevka', monospace;
}

#noscript {
    width: 100%;
    color: var(--error-text);
    background-color: var(--error-bg);
    text-align: center;
    font-size: 16px;
    line-height: 20px;
    padding: 6px 0 8px 0;
}

/* Header & Title Spacing */

#header {
    margin-top: 9px;
    margin-bottom: 40px; /* Gives a clean breathing room above the body content */
    padding-bottom: 0px; 
    margin-left: 9px;
    overflow: hidden; /* This acts as a safeguard to prevent any future overlaps */
}

/* style.css */
#title-l1 {
    min-height: 40px; /* Prevents the page layout from jumping when text appears */
    display: flex;
    justify-content: center;
    align-items: center;
}

.cursor {
    font-weight: 700;
    color: var(--accent);
    margin-left: 2px;
    animation: blink 0.8s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

#header-main-info {
    /* Removing 'float: left;' forces the document to respect the height of the nav bar */
    display: block; 
    width: 100%;
}

a, a:visited, a:link {
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
}

a:hover {
    text-decoration: underline;
}

/* Navigation Buttons */
#title-l2 {
    margin-top: 50px; 
    margin-bottom: 50px; 
}

button.nav-btn {
    margin: 0px 12px 10px 0px;
    padding: 6px 14px;
    background-color: var(--btn-bg);
    border: solid 1px var(--border-main);
    color: var(--text-primary);
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 18px;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border 0.2s;
    font-weight: 500;
    letter-spacing: 0.3px;
}

button.nav-btn:hover {
    background-color: var(--btn-hover);
}

button.nav-btn:focus {
    outline: 0;
}

/* Theme Toggle Switch */
.theme-switch-wrapper {
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    margin-left: 10px;
    margin-top: -10px;
}

.theme-switch {
    position: relative;
    display: inline-block;
    width: 64px;
    height: 34px;
}

.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* Light Mode Switch Track */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0;
    background-color: #e4e4e4;
    transition: 0.4s;
    border-radius: 34px;
    box-shadow: inset 1px 2px 5px rgba(0, 0, 0, 0.15);
}

/* Light Mode Switch Thumb */
.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: #ffffff;
    transition: 0.4s;
    border-radius: 50%;
    box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.25);
}

/* Dark Mode Switch Track */
input:checked + .slider {
    background-color: #424242;
    box-shadow: inset 1px 2px 5px rgba(0, 0, 0, 0.4);
}

/* Dark Mode Switch Thumb */
input:checked + .slider:before {
    transform: translateX(30px);
    background-color: #5e5e5e;
    box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.4);
}

/* Table Styling */
table {
    width: 100%;
    border-collapse: collapse;
    background-color: transparent;
}

thead, th, .header {
    padding: 0px;
    font-weight: normal;
    text-align: left;
}

.table-borderless tbody tr td, 
.table-borderless tbody tr th, 
.table-borderless thead tr th {
    border: none;
    vertical-align: middle;
}

tbody.main {
    border-bottom: solid 1px var(--border-main);
}

tr.linked {
    border-top: solid 1px var(--border-main);
    border-bottom: none;
    margin-bottom: 1px;
    cursor: pointer;
}

/* Drop-down detail row */
tr.details-row {
    display: none;
    background-color: var(--bg-secondary);
}

tr.details-row.open {
    display: table-row;
}

.details-content {
    padding: 10px 8px 30px 8px !important;
    font-size: 16px;
    line-height: 24px;
    color: var(--text-primary);
}

.details-label {
    text-transform: uppercase;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 0.5px;
    margin-top: 15px;
    margin-bottom: 5px;
    color: var(--text-secondary);
}

/* Arrow toggles */
.toggle-arrow {
    display: inline-block;
    transition: transform 0.2s;
    font-size: 14px;
}
tr.linked.open .toggle-arrow {
    transform: rotate(180deg);
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    table { border: none; }
    thead { display: none; }
    
    tr, .table>tbody>tr {
        padding: 8px 0px 10px 0px;
        float: left;
        width: 100%;
    }
    
    td, .table>tbody>tr>td {
        padding: 3px 8px 0px 8px;
        float: left;
        width: 100%;
    }
    
    .table>tbody>tr>td {
        font-size: 16px;
        line-height: 22px;
    }
    
    tr.details-row.open {
        display: block;
        border-bottom: 1px solid var(--border-light);
    }

    .window-content {
        font-size: 14px;
        line-height: 18px;
    }
}

/* Medium Desktop */
@media (max-width: 1000px) {
    #main-content { margin: 0.7em 0.9em 0.7em 0.9em; }
    body { font-size: 13px; line-height: 16px; }
    #title-l1 { font-size: 32px; line-height: 40px; }
    #footer { font-size: 11px; margin-left: 21px; margin-top: 20px; color: var(--text-secondary); }
}

/* Large Desktop */
@media (min-width: 601px) {
    .table>tbody>tr>td, .table>thead>tr>th {
        padding: 14px 8px 14px 8px;
        transition: 0.05s ease-in;
    }
    tr.linked:hover > td {
        padding: 20px 8px 20px 8px;
    }
}

@media (min-width: 1001px) {
    #main-content { margin: 1.2em 1.7em 1.5em 1.5em; }
    #title-l1 { font-size: 32px; line-height: 40px; }
    #footer { font-size: 13px; margin: 35px 0px 0px 24px; color: var(--text-secondary); }
}

/* About Page Styles */
#about-intro {
    margin: 0 0 40px 0;
    padding: 20px 0;
    font-size: 18px;
    line-height: 26px;
}

#team-section h2 {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-main);
    padding-bottom: 10px;
}

.team-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 40px;
}

.team-member {
    border: 1px solid var(--border-main);
    padding: 20px;
    background-color: var(--bg-primary);
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
}

.member-photo {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.photo-placeholder {
    width: 200px;
    height: 200px;
    border: 1px dashed var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--text-secondary);
    background-color: var(--bg-secondary);
}

.member-info {
    text-align: left;
    flex: 1;
}

.member-name {
    font-size: 24px;
    font-weight: bold;
    margin: 0 0 10px 0;
}

.member-bio {
    font-size: 20px;
    line-height: 22px;
    color: var(--text-secondary);
    margin: 0;
}

/* Coming Soon Page Styles */
#coming-soon-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
    margin: 200px 0;
}

.coming-soon-title {
    font-size: 48px;
    font-weight: bold;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-main);
    padding-bottom: 20px;
}

.coming-soon-message {
    font-size: 20px;
    line-height: 28px;
    margin: 20px 0;
    max-width: 600px;
}

.coming-soon-subtitle {
    font-size: 16px;
    line-height: 24px;
    color: var(--text-secondary);
    margin-top: 30px;
}

/* Methods Page Styles */
.callout-note {
    background-color: var(--bg-secondary);
    border: 1px solid var(--accent);
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 30px;
    font-size: 16px;
    line-height: 22px;
    color: var(--text-primary);
}

#methods-section h2 {
    font-size: 24px;
    font-weight: bold;
    margin: 30px 0 20px 0;
    border-bottom: 1px solid var(--border-main);
    padding-bottom: 10px;
}

#methods-section h3 {
    font-size: 18px;
    font-weight: bold;
    margin: 25px 0 15px 0;
    color: var(--text-primary);
}

#methods-section ul, 
#methods-section ol {
    font-size: 16px;
    line-height: 24px;
    margin-bottom: 20px;
    padding-left: 30px;
}

#methods-section li {
    margin-bottom: 10px;
}

#methods-section code {
    background-color: var(--code-bg);
    padding: 2px 6px;
    font-size: 14px;
    border-radius: 3px;
    color: var(--text-primary);
}

#methods-section p {
    font-size: 16px;
    line-height: 24px;
    margin-bottom: 15px;
}


/* Floating Draggable Windows */
.draggable-window {
    position: absolute;
    width: 90%;          /* Allows the window to shrink on small screens */
    max-width: 400px;    /* Change this value to your desired maximum width */
    background-color: var(--bg-primary);
    border: 1px solid var(--border-main);
    border-radius: 12px;
    box-shadow: 8px 8px 20px rgba(0, 0, 0, 0.2);
    cursor: grab;
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    z-index: 10;
}

[data-theme="dark"] .draggable-window {
    box-shadow: 8px 8px 20px rgba(0, 0, 0, 0.5);
}

.draggable-window:hover {
    transform: scale(1.03) translateY(-4px);
    box-shadow: 12px 12px 30px rgba(0, 0, 0, 0.4);
    z-index: 100; /* Pops the hovered window to the front */
}

[data-theme="dark"] .draggable-window:hover {
    box-shadow: 12px 12px 30px rgba(0, 0, 0, 0.7);
}

.draggable-window.dragging {
    transition: none; /* Disables the animation during drag to prevent cursor lag */
    transform: scale(1.03); 
    box-shadow: 16px 16px 35px rgba(0, 0, 0, 0.35);
    cursor: grabbing;
}

[data-theme="dark"] .draggable-window.dragging {
    box-shadow: 16px 16px 35px rgba(0, 0, 0, 0.8);
}

.window-content {
    padding: 25px;
    font-size: 24px;
    line-height: 1.5;
    color: var(--text-primary);
    pointer-events: none; /* Prevents text highlighting from interrupting the drag action */
}

.draggable-window.chart-window {
    width: 95%;          /* Flexible width */
    max-width: 500px;    /* Larger maximum width for charts */
}

.draggable-window.chart-window .window-content {
    padding: 18px;
    pointer-events: auto;
}

.draggable-window.chart-window h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-family: 'Iosevka', monospace;
    color: var(--accent);
}

.chart-window canvas {
    display: block;
    width: 100% !important;
    height: 260px !important;
}

/* Data Page Styles */
#data-content {
    margin: 0;
}

#data-intro {
    margin: 0 0 60px 0;
    padding: 20px 0;
}

#data-intro h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 15px;
    font-family: 'Iosevka', monospace;
}

#data-intro p {
    font-size: 18px;
    line-height: 26px;
    margin-bottom: 30px;
}

#download-section {
    margin: 30px 0;
}

.download-btn {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--btn-bg);
    color: white;
    text-decoration: none;
    font-family: 'Iosevka', monospace;
    font-weight: 700;
    border: 2px solid var(--accent);
    cursor: pointer;
    transition: 0.2s ease-in-out;
    font-size: 16px;
}

.download-btn:hover {
    background-color: transparent;
    color: var(--accent);
}

#data-dictionary {
    margin-top: 60px;
}

#data-dictionary h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 25px;
    font-family: 'Iosevka', monospace;
}

.dictionary-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.dictionary-entry {
    padding: 20px;
    border-left: 4px solid var(--accent);
    background-color: var(--bg-secondary);
    border-radius: 2px;
}

.dictionary-entry h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Iosevka', monospace;
    color: var(--accent);
}

.dictionary-entry p {
    margin: 8px 0;
    font-size: 16px;
    line-height: 24px;
}

.dictionary-entry ul {
    margin: 12px 0;
    padding-left: 25px;
}

.dictionary-entry ul li {
    margin: 6px 0;
    line-height: 22px;
}

.dictionary-entry strong {
    font-weight: 700;
}


.glitch-active {
    animation: glitch-jitter 0.2s linear infinite;
    /* Uses existing project colors for the split-color effect */
    text-shadow: 2px 0 var(--accent), -2px 0 var(--text-secondary);
    filter: brightness(1.2);
}

@keyframes glitch-jitter {
    0% { transform: translate(0); }
    20% { transform: translate(-3px, 2px); clip-path: inset(10% 0 30% 0); }
    40% { transform: translate(-2px, -2px); clip-path: inset(40% 0 10% 0); }
    60% { transform: translate(3px, 2px); clip-path: inset(20% 0 50% 0); }
    80% { transform: translate(2px, -2px); clip-path: inset(60% 0 20% 0); }
    100% { transform: translate(0); }
}

/* style.css */
#view-controls {
    margin-bottom: 30px;
    display: flex;
    justify-content: flex-start; /* Aligns with the left side of your table */
}

.control-btn {
    font-family: 'Iosevka', monospace;
    background-color: transparent;
    border: 1px solid var(--border-main);
    color: var(--text-primary);
    padding: 6px 12px;
    cursor: pointer;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background-color: var(--bg-secondary);
    border-color: var(--accent);
}

/* This class will be toggled via JavaScript */
.windows-hidden {
    display: none !important;
}


/* style.css */

/* 1. The Scroll Container */
#full-table {
    width: 100%;
    max-height: 1500px; /* Adjust this to your preferred height */
    overflow-y: hidden; /* Controlled by JS */
    position: relative;
}

/* 2. The Table Structure */
#myTable {
    width: 100%;
    table-layout: fixed; /* Forces columns to stay the same width */
    border-collapse: collapse;
}

/* 3. Sticky Headings */
#myTable thead {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--bg-primary); /* Prevents rows from showing through text */
}

#myTable thead th {
    background-color: var(--bg-primary);
    border-bottom: 2px solid var(--border-main);
    padding: 15px 8px;
}

/* 4. Ensure Body Rows fill width */
#data-container {
    width: 100%;
}

#myTable td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Ensure detail rows don't break the layout when open */
tr.details-row.open {
    display: table-row;
}

/* style.css */

.window-content a {
    pointer-events: auto; /* Overrides the parent's "none" state */
    position: relative;
    z-index: 10; /* Ensures the link stays on top of the content layer */
    text-decoration: underline;
    color: var(--accent); /* Uses your project's accent color for the link */
}

.window-content a:hover {
    color: var(--text-secondary);
    filter: brightness(1.2);
}