:root {
    --base-corner-radius: 10px;
    --main-bg-color: white;
    --header-bg: url("../img/background_100.jpg");
    --button-bg-color: white; /* primary button background */
    --fail-bg-color: #F38CA9; /* fail status background */
    --success-bg-color: #C8F5D3; /* success status background */
    --log-font-color:  #666;
    --landing-bg-color: #7C00FF;
    --color-accent: #7C00FF;
    --inm-bg-color: #efefff;
}

/*
 * General settings --------------------------------
 */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Roboto, sans-serif;
    background: var(--main-bg-color);
    color: #333;
}

h1 {

}

h2 {
    color: black;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

button {
    background: white;
    color: black;
    border: 0.125rem solid black;
    padding: 0.6rem 1.2rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s ease-in-out,
    box-shadow 0.2s ease-in-out;
    box-shadow: 0.125rem 0.125rem 0.375rem rgba(0, 0, 0, 0.2);
}

button:hover {
    background: #f5f5f5;
    box-shadow: 0.1875rem 0.1875rem 0.5rem rgba(0, 0, 0, 0.3);
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

button.button-inline {
    display: inline-block;
}

.button {
    background: white;
    color: black;
    border: 0.125rem solid black;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    box-shadow: 0.125rem 0.125rem 0.375rem rgba(0, 0, 0, 0.2);
    text-align: center;
}

.button:hover {
    background: #f5f5f5;
    box-shadow: 0.1875rem 0.1875rem 0.5rem rgba(0, 0, 0, 0.3);
}

input[type="file"] {
    display: none;
}

.input-wrapper-select label {
  display: block;
  font-size: 0.9rem;
}

.input-wrapper-select select {
  display: block;
  width: 100%;
  font-size: 1rem;
}

table {
    border-collapse: collapse;
    width: 100%;
    background: white;
    border-radius: 0.5rem;
    overflow: auto;
    box-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.05);
}

th, td {
    border: 0.0625rem solid #eee;
    padding: 0.6rem 1rem;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 20em;
}

th {
    background: white; /* slightly darker than #FAF0E6 */
    text-align: left;
    font-weight: 600;
}

td.status {
    width: 2rem;
    text-align: center;
}

th.row-number, th.inm-column {
    background-color: var(--inm-bg-color);
}

.success td.row-number {
    background-color: var(--success-bg-color);
}

.fail td.row-number {
    background-color: var(--fail-bg-color);
}

ul {
    list-style-position: outside;
    padding-left: 1.5em;
    margin-left: 0;
}

.accent {
    color: var(--color-accent);
}

/**
 * Page container and layout --------------------------------
 */

canvas#warpCanvas {
    display: none;
    width: 100%;
    height: 100%;
    /*mix-blend-mode: multiply;*/
}

#pageWidget {
    margin: 0;
    height: 100%;
    display: flex;
    flex-direction: column; /* stack children vertically */
}

#contentWrapper {
    flex: 1;
    overflow: auto;
}

/* Header */

header {
    position: relative;
    background: var(--header-bg);
    background-size: cover;
    background-position: center;
    color: white;
    padding: 0.5rem 2rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    z-index: 1;
    height: 80px;
    display: flex;
}

header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 240, 245, 0.3);
    pointer-events: none;
    z-index: 0;
}

header a {
    display: flex;
    align-items: center;
    gap: 15px;
}

header a,
header a:hover,
header a:focus {
    text-decoration: none;
}

/* Logo styling */
.headerLogo {
    height: 95%;
    width: auto;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    margin-right: 0.5em;
}

h1.headerTitle {
    font-family: monospace; /* typewriter style */
    color: #000000; /* black text */
    font-size: 1.4rem; /* adjust as needed */
    margin: 0; /* remove default margin */
    position: relative;
    font-weight: 570;
    z-index: 2; /* above overlay */
    letter-spacing: 1px; /* optional typewriter spacing */
}


.two-columns {
    display: flex;
    flex-wrap: wrap; /* allows stacking on smaller screens */
    gap: 2rem; /* space between the boxes */
    justify-content: center; /* centers the boxes horizontally */
    padding: 2rem; /* space from screen edges */
    box-sizing: border-box;
}

.two-columns section {
    flex: 1 1 18.75rem; /* grow, shrink, min width */
    box-sizing: border-box;
    padding: 1.5rem;
    background: #fafafa;
    border-radius: 0.75rem;
    box-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.08);
}

.text-block {
    max-width: 37.5rem;
    margin-bottom: 2em;
}

/*
 * Intro section --------------------------------
 */

section#introWrapper {
    display: flex;
    flex-direction: row;
}

section#introWrapper div.text-block {
    flex: 2;
    padding: 0.5rem 1rem;
    margin: 0.5rem 1rem 0;
    font-size: 1rem;
    max-width: 70rem;
}

#contentWrapper > section > div.text-block {
    padding: 0 2rem 1rem 2rem;
    font-size: 1rem;
    max-width: 70rem;
}

/*
 * Fetch section --------------------------------
 */

.box {
    padding: 1.5rem;
    background: white;
    border-radius: var(--base-corner-radius);
    margin: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1rem;
}

#fetchWidget {
    display: flex;
}

#fileName {
    margin-left: 1rem;
    font-style: italic;
    color: #333;
}

/* Progress controls */
#progressControls {
    display: flex;
    flex: 1;
}

#progress {
    font-weight: bold;
    margin-left: 2em;
}

/* Thumbnails area */
#thumbsWidget {
    flex: 1;
    display: flex;
    flex-wrap: wrap; /* wrap into new rows */
    justify-content: flex-start; /* align items to the left */
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 1rem;

    height: auto; /* grow as needed */
    max-height: none; /* no cutoff */
    overflow: hidden;
}

/* Thumbnails */
#thumbsWidget img {
    max-width: 9.375rem; /* don’t upscale */
    height: auto; /* keep proportions */
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
    object-fit: contain; /* never crop */
}

/*
 * Data section --------------------------------
 */

#dataWrapper {
    display: flex;
    flex-direction: row;
    flex: 1; /* middle row grows */
    padding: 1rem; /* spacing so table isn’t glued to edges */
    overflow: auto;
}

/* Table */
.tableWrapper {
    flex: 2;
    overflow: auto;
}

/* Log */
#logWidget {
    flex: 1;
    display: none;
    overflow: auto;
    margin-left: 3em;
}

#logWidget.log-notempty {
    display: flex;
}

#toggleLogBtn,
#showLogBtn {
    display: none;
}

/* Log Viewer Styles */
.log-section {
    border-top: 0.0625rem solid #ccc;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
}

.log-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    background-color: var(--fail-bg-color);
    border-bottom: 1px solid #ddd;
}

.log-header h3 {
    margin: 0;
    font-size: 1rem;
}

.log-header button {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border: 0.0625rem solid #ccc;
    background: white;
    cursor: pointer;
    border-radius: 0.1875rem;
}

.log-header button:hover {
    background: #f0f0f0;
}

.log-data {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.log-entry {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 0.1875rem;
    border-left: 0.1875rem solid var(--fail-bg-color);
    color: var(--log-font-color);
    font-size: 0.75rem;
}

.log-meta {
    white-space: nowrap;
    margin-bottom: 0.25rem;
}

.log-meta div {
    display: inline-block;
}

.log-details {
    padding-top: 0.25rem;
}

/*
 * Footer section --------------------------------
 */
footer {
    display: flex;
    margin-top: auto;
    justify-content: space-between; /* text left, logos right */
    align-items: center;
    padding: 0.9375rem 1.875rem;
    background-color: white;
    color: black;
}

#footertext p {
    margin: 0;
    font-weight: normal;
    font-size: 0.8rem;

}

#footertext a {
    color: black;
    text-decoration: none;
}

#footertext a.accent {
  color: var(--color-accent);
}

#footertext a:hover {
    text-decoration: underline;
}

/* Logos container */
#inslogo {
    display: flex;
    gap: 0.625rem;
    align-items: center;
}

/* Logos themselves */
#inslogo img {
    height: 3.125rem; /* small size */
    width: auto; /* keep aspect ratio */
    filter: brightness(0); /* make black */
}

/* Buttons */
.linkbutton {
    display: inline-block; /* works well inside <h1> */
    background: white;
    color: black;
    border: 0.125rem solid var(--landing-bg-color); /* 2px → 0.125rem */
    padding: 0.6rem 1.2rem; /* already in rem, keep */
    border-radius: 0.5rem; /* 8px → 0.5rem */
    cursor: pointer;
    font-size: 1rem;
    line-height: 1.5; /* vertical centering */
    width: 14rem;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    box-shadow: 0.125rem 0.125rem 0.375rem rgba(0, 0, 0, 0.2); /* 2px 2px 6px → 0.125rem 0.125rem 0.375rem */
}

.linkbutton:hover {
    background: #f0f0f0;
    box-shadow: 0.25rem 0.25rem 0.625rem rgba(0, 0, 0, 0.3); /* hover shadow slightly bigger */
}


/* Small screens */

@media (max-width: 600px) {
    #contentWrapper {
        overflow: visible;
    }

    .two-columns {
        flex-direction: column; /* stack columns vertically */
        padding: 1rem; /* reduce padding a bit on smaller screens */
        gap: 1.5rem; /* less gap between sections */
    }

    .two-columns section {
        flex: 1 1 100%; /* full width for each section */
        padding: 0.9rem;
        font-size: 1.1rem;
    }

    /* let text block fill available width */
    section#introWrapper div.text-block,
    .text-block {
        max-width: 100%;
        flex: auto;
    }

    /* Increase header font-size and height a bit on mobile */
    header {
        height: 100px;
        padding: 1rem 1.5rem;
    }

    h1.headerTitle {
        font-size: 1.8rem; /* bigger heading */
    }

    .headerLogo {
        max-height: 80px;
    }

    .hide-small {
        display: none;
    }

    #fetchWidget,
    .inputWrapper {
        flex-direction: column;
    }
}

@media (max-width: 400px) {
    .headerLogo {
        max-height: 60px;
    }
}
