/* ============================================================
   EMVlab — Modern Stylesheet
   ============================================================ */

/* --- Reset & Base --- */

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #2d2d2d;
    background-color: #f4f4f0;
    margin: 0;
}

/* --- Links --- */

a {
    color: #034da1;
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: #0260c9;
    text-decoration: underline;
}

/* --- Topbar --- */

.topbar {
    background-color: #1a1a2e;
    color: #f6be00;
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 0.8rem 1.5rem;
}

.pageheader {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #f6be00;
    text-decoration: none;
    margin: 0;
}

a.pageheader:hover {
    color: #ffd740;
    text-decoration: none;
}

/* --- Sidebar --- */

.layout {
    display: flex;
    gap: 0;
    align-items: flex-start;
}

.sidebar {
    min-width: 180px;
    padding: 1rem 1.5rem;
    flex-shrink: 0;
}

.main {
    flex: 1;
    min-width: 0;
    padding: 0.5rem 1rem;
}

.sidebar a {
    display: inline-block;
    padding: 0.15em 0;
    transition: color 0.15s ease;
}

.sidebar a:hover {
    color: #f6be00;
    text-decoration: none;
}

.sidebartitle {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #777;
    font-weight: 600;
}

/* --- Content Area --- */

.pagecontent {
    background-color: #fff;
    padding: 2rem;
    margin: 0;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* --- Tables (general) --- */

td {
    padding: 0.5rem 0.6rem;
    background-color: white;
}

th {
    font-weight: 500;
    background-color: #1a1a2e;
    color: #f6be00;
    padding: 0.6rem 0.8rem;
    text-align: left;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.even td {
    background-color: #fef8e0;
}

/* --- Form Elements --- */

input[type="text"],
textarea,
select {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', 'Courier New', monospace;
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fafafa;
    color: #2d2d2d;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #f6be00;
    box-shadow: 0 0 0 3px rgba(246, 190, 0, 0.15);
    background-color: #fff;
}

textarea {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', 'Courier New', monospace;
}

input[type="submit"],
input[name="commit"] {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background-color: #1a1a2e;
    color: #f6be00;
    border: 1px solid #2a2a4e;
    padding: 0.5rem 1.25rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="submit"]:hover,
input[name="commit"]:hover {
    background-color: #2a2a4e;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

input[type="submit"]:active,
input[name="commit"]:active {
    background-color: #0f0f1e;
}

#mysubmit {
    height: auto;
    padding: 0.5rem 1.25rem;
}

input[type="radio"] {
    accent-color: #f6be00;
    margin-right: 0.3em;
}

input[type="file"] {
    font-size: 0.9rem;
    padding: 0.4rem;
}

label {
    font-weight: 500;
    color: #333;
    font-size: 0.95rem;
}

fieldset {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

legend {
    font-weight: 600;
    color: #333;
    padding: 0 0.5em;
    font-size: 0.95rem;
}

/* --- Homepage Tool Links --- */

.biglink {
    font-size: 1.05rem;
    font-weight: 500;
    color: #034da1;
}

.biglink:hover {
    color: #f6be00;
}

/* --- Error & Validation --- */

.error, .errormessage {
    color: #c0392b;
    font-size: 0.85rem;
}

.error {
    margin: 4px 0;
}

.errormessage {
    background-color: #fdf0ef;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}


/* --- Example / Hint Text --- */

.example {
    color: #888;
    font-size: 0.8rem;
}

/* --- Alert / Notice Boxes --- */

.alert-box {
    color: #555;
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
}

.alert-box span {
    font-weight: bold;
}

.notice {
    background: #eef7fc;
    border: 1px solid #b8dff0;
}

/* --- Code Elements --- */

code {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    background-color: #f5f5f0;
    padding: 0.15em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
}

/* --- TLV Decode Tables --- */

table.tlvdecode {
    border-width: 0px;
    padding: 0px;
    margin: 0px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

td.tlvdecode {
    border-left: 1px dotted #999;
    padding: 3px;
    background-color: white;
}

td.tlvout {
    border-left: 1px dotted #999;
    border-bottom: 1px dotted #999;
    background-color: white;
}

td.tlvprimitive {
    border-left: 0px none;
    border-bottom: 1px dotted #999;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    background-color: white;
}

/* --- Footer --- */

.pagecontent > p[align="center"] {
    font-size: 0.8rem;
    color: #888;
    line-height: 1.5;
}

.pagecontent > p[align="center"]:first-of-type {
    border-top: 1px solid #eee;
    padding-top: 1.5rem;
    margin-top: 2rem;
}

/* --- Highlight (search results) --- */

strong.highlight {
    background-color: #fff3cd;
    border-radius: 2px;
}

/* --- Layout Overrides for outer table structure --- */

center {
    text-align: left;
}

