/* ==================== RESET & BASE ==================== */
*, *::before, *::after {
    box-sizing: border-box;
}

/* ==================== CHICAGOFLF – Mac OS 8 Nostalgia Font ==================== */
@font-face {
    font-family: 'ChicagoFLF';
    src: url('fonts/ChicagoFLF.woff2') format('woff2'),
         url('fonts/ChicagoFLF.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Core Body */
body {
    background-color: #bfbfbf;
    background-image: url('img/bg-tile2.png');
    background-repeat: repeat;
    background-attachment: fixed;
    margin: 0;
    padding: 0;
    font-family: 'ChicagoFLF', "Chicago", "Geneva", system-ui, sans-serif;
    font-size: 12px;
    line-height: 1.45;
    letter-spacing: 0.02em;
    color: #111;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ==================== TOP BAR ==================== */
#top-bar {
    display: flex;
    align-items: center;
    background: #111;
    color: #e8e8e8;
    padding: 6px 16px;
    min-height: 32px;
    gap: 16px;
}

#marquee-track {
    display: inline-flex;
    align-items: center;
    gap: 2rem;
    padding-left: 4rem;
    animation: marquee 35s linear infinite;
}

#fortune-marquee {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
}

#marquee-fortune {
    display: inline-block;
    padding-left: 100%;
    animation: fortuneMarquee 16s linear infinite;
}

@keyframes marquee {
    to { transform: translateX(-50%); }
}

#fortune-marquee:hover #marquee-fortune {
    animation-play-state: paused;
}

#language-switcher {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

#language-switcher a {
    font-family: "Segoe UI Emoji", "Twemoji Mozilla", "Noto Color Emoji", "Apple Color Emoji", sans-serif;
    text-decoration: none;
    opacity: 0.8;
    transition: all 0.2s ease;
}

#language-switcher a:hover {
    opacity: 1;
}

#language-switcher img {
    border: 1px solid #808080;
    image-rendering: pixelated;
    vertical-align: middle;
    width: 18px;
    height: 12px;
    opacity: 0.85;
    transition: opacity 0.15s ease-in-out;
}

/* ==================== FORTUNE STRIP ==================== */
#fortune-strip {
    background: #111;
    color: #e8e8e8;
    font-size: 11px;
    padding: 5px 16px;
    text-align: center;
    letter-spacing: 0.03em;
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#fortune-strip .fortune-text { font-style: italic; }
#fortune-strip .fortune-author { color: #888; }

/* ==================== BRANDING HEADER ==================== */
#branding-header {
    background-image: url('img/black-tile.png');
    border-top: 3px solid #000;
    border-bottom: 3px solid #000;
    padding: 18px 0;
}

#branding-header .content-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 24px;
    padding: 0 20px;
}

#branding-logo-area h1 {
    margin: 0;
    font-family: 'ChicagoFLF', "Chicago", "Geneva", sans-serif;
    font-size: 36px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -1.5px;
    text-shadow: 2px 2px 0 #000;
    line-height: 1;
}

#branding-logo-area h1 span { color: #c42b2c; }

#branding-tagline {
    color: #aaa;
    font-size: 11px;
    margin: 4px 0 0 0;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

#branding-copy {
    flex: 1;
    min-width: 200px;
    color: #ccc;
    font-size: 12px;
    line-height: 1.6;
}

#branding-copy strong { color: #fff; font-weight: 800; }

@media (max-width: 600px) {
    #branding-copy {
        flex-basis: 100%;
        border-top: 1px solid #333;
        padding-top: 12px;
    }
}

/* ==================== CONTENT WRAPPER ==================== */
.content-wrapper {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (max-width: 900px) {
    .content-wrapper {
        max-width: 100%;
        padding: 0 15px;
    }
}

.window {
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
}

/* ==================== VISITOR COUNTER ==================== */
#visit-counter {
    text-align: center;
}

#visit-counter img {
    border: 2px solid #000;
    box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #808080;
    background: #c0c0c0;
    padding: 4px;
    image-rendering: pixelated;
}

/* ==================== PLATINUM WINDOW STYLES ==================== */
:root {
    --platinum-bg: #c0c0c0;
    --platinum-light: #e8e8e8;
    --platinum-dark: #606060;
    --platinum-black: #000000;
    --inner-bg: #d8d8d8;
}

.window {
    background: var(--platinum-bg);
    border-top: 1px solid var(--platinum-light);
    border-left: 1px solid var(--platinum-light);
    border-bottom: 1px solid var(--platinum-dark);
    border-right: 1px solid var(--platinum-dark);
    outline: 1px solid var(--platinum-black);
    padding: 2px;
    box-shadow: 5px 5px 0 0 rgba(0,0,0,0.2);
    position: relative;
}

.title-bar {
    height: 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(#c0c0c0, #c0c0c0) top / 100% 2px no-repeat,
        linear-gradient(#c0c0c0, #c0c0c0) bottom / 100% 4px no-repeat,
        repeating-linear-gradient(to bottom, #b8b8b8 0px, #b8b8b8 1px, #d4d4d4 1px, #d4d4d4 2px) right center / calc(97% - 8px) 100% no-repeat,
        linear-gradient(#a8a8a8, #a8a8a8) right top / 1px 100% no-repeat;
    border-bottom: 1px solid var(--platinum-black);
}

.title-bar.active {
    background:
        linear-gradient(#c0c0c0, #c0c0c0) top / 100% 2px no-repeat,
        linear-gradient(#c0c0c0, #c0c0c0) bottom / 100% 4px no-repeat,
        repeating-linear-gradient(to bottom, #888888 0px, #888888 1px, #dddddd 1px, #dddddd 2px) right center / calc(97% - 8px) 100% no-repeat,
        linear-gradient(#a8a8a8, #a8a8a8) right top / 1px 100% no-repeat;
}

.title-bar .title-text {
    font-size: 12px;
    color: var(--platinum-black);
    padding: 0 24px;
    white-space: nowrap;
    background: var(--platinum-bg);
    line-height: 18px;
}

.close-box {
    position: absolute;
    left: 1px;
    top: 45%;
    transform: translateY(-50%);
    width: 13px;
    height: 13px;
    background: var(--platinum-bg);
    border-top:    1px solid var(--platinum-light);
    border-left:   1px solid var(--platinum-light);
    border-bottom: 1px solid var(--platinum-dark);
    border-right:  1px solid var(--platinum-dark);
    outline: 1px solid var(--platinum-black);
    z-index: 2;
    cursor: default;
}

.zoom-box {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 13px;
    height: 13px;
    background: var(--platinum-bg);
    border-top:    1px solid var(--platinum-light);
    border-left:   1px solid var(--platinum-light);
    border-bottom: 1px solid var(--platinum-dark);
    border-right:  1px solid var(--platinum-dark);
    outline: 1px solid var(--platinum-black);
    z-index: 2;
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-box:hover, .zoom-box:hover { background: #aaaaaa; }

.zoom-box::before {
    content: '';
    width: 5px;
    height: 5px;
    border-top: 1px solid var(--platinum-black);
    border-right: 1px solid var(--platinum-black);
}

.content {
    background: var(--inner-bg);
    border-top: 2px solid var(--platinum-dark);
    border-left: 2px solid var(--platinum-dark);
    border-bottom: 2px solid var(--platinum-light);
    border-right: 2px solid var(--platinum-light);
    padding: 24px;
}

/* ==================== AD BANNERS ==================== */
.ad-banner {
    width: 728px;
    max-width: 98%;
    height: 90px;
    background: #c8c8c8;
    border: 1px dashed #888;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 24px auto;
    font-size: 11px;
    color: #777;
    letter-spacing: 0.05em;
}

/* ==================== HIDDEN UTILITY ELEMENTS ==================== */
#pdf_input_container {
    display: none;
}

/* ==================== GANG BAR ==================== */
#gang-bar {
    text-align: center;
    padding: 10px;
    line-height: 0;
}

#gang-bar img {
    width: 342px;
    height: 100%;
    display: inline-block;
}

/* ==================== INPUTS ==================== */
input[type="range"] {
    width: 100%;
}

/* ==================== PANELS & BUTTONS ==================== */
.panel {
    background: #dcd8d0;
    border: 1px solid #000;
    box-shadow: inset -1px -1px 0 #ffffff, inset 1px 1px 0 #808080;
    margin: 20px 0;
    padding: 10px;
    overflow: auto;
}

button {
    background: #c0c0c0;
    border: 2px solid #000;
    border-radius: 6px;
    box-shadow: inset -2px -2px 0 #ffffff, inset 2px 2px 0 #808080;
    padding: 6px 20px;
    font-size: 12px;
    cursor: pointer;
    font-family: 'ChicagoFLF', "Chicago", "Geneva", sans-serif;
}

button:active {
    box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #808080;
    transform: translate(1px, 1px);
}

/* INFO / LINKS SECTIONS */
#info-section, #links-section {
    background: #d4d0c8;
    border: 1px solid #808080;
    box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #808080;
    padding: 16px 20px;
    font-size: 12px;
    line-height: 1.65;
    color: #222;
    margin: 20px 0;
}

#tos-link { color: #00008b; text-decoration: underline; font-weight: bold; cursor: pointer; }
#tos-link:hover { color: #0000cc; }

#tos-panel {
    display: none;
    background: #fffef5;
    border: 1px solid #000;
    box-shadow: inset -1px -1px 0 #ffffff, inset 1px 1px 0 #808080;
    padding: 14px 16px;
    font-size: 11px;
    line-height: 1.75;
    margin-top: 10px;
    max-height: 200px;
    overflow-y: auto;
}

/* LINK CHIPS */
.links-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.link-chip {
    background: #c0c0c0;
    border: 2px solid #000;
    border-radius: 6px;
    box-shadow: inset -2px -2px 0 #ffffff, inset 2px 2px 0 #808080;
    padding: 6px 20px;
    font-size: 12px;
    font-family: 'ChicagoFLF', "Chicago", "Geneva", sans-serif;
    color: #00008b;
    text-decoration: none;
    cursor: pointer;
    display: inline-block;
}

.link-chip:hover {
    background: #d4d0c8;
    text-decoration: underline;
}

.link-chip:active {
    box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #808080;
    transform: translate(1px, 1px);
}

/* FOOTER */
#site-footer {
    background-image: url('img/black-tile.png');
    color: #888;
    font-size: 10px;
    padding: 18px 24px;
    margin-top: 32px;
    border-top: 2px solid #000;
    border-bottom: 2px solid #000;
    text-align: center;
    line-height: 1.8;
}

#site-footer a { color: #aaa; text-decoration: none; }
#site-footer a:hover { color: #ccc; text-decoration: underline; }

/* TOS MODAL */
#tos-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#tos-modal-overlay.tos-hidden {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

#tos-modal {
    background: #c0c0c0;
    border: 2px solid #000;
    box-shadow: inset -2px -2px 0 #808080, inset 2px 2px 0 #ffffff, 4px 4px 0 #000;
    width: 480px;
    max-width: 94vw;
    font-size: 11px;
}

#tos-modal .modal-titlebar {
    height: 26px;
    background-image: url('img/hazard-tile.png');
    background-color: #000080;
    display: flex;
    align-items: center;
    padding: 0 8px;
    color: #fff;
    text-shadow: 2px 2px #101010;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 0.03em;
}

#tos-modal .modal-body {
    padding: 16px 18px;
    line-height: 1.7;
    color: #111;
    max-height: 52vh;
    overflow-y: auto;
}

#tos-modal .modal-body h3 {
    font-size: 12px;
    text-transform: uppercase;
    margin: 0 0 10px 0;
    letter-spacing: 0.05em;
}

#tos-modal .modal-body p { margin: 0 0 8px 0; }

#tos-modal .modal-footer {
    padding: 10px 18px 14px;
    text-align: right;
    border-top: 1px solid #808080;
}

/* ==================== GENERAL MODAL OVERLAY (Privacy / About / Contact) ==================== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.55);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay.show { display: flex; }

.modal-window {
    background: #c0c0c0;
    border: 2px solid #000;
    box-shadow: inset -2px -2px 0 #808080, inset 2px 2px 0 #ffffff, 4px 4px 0 #00000042;
    width: 460px;
    max-width: 94vw;
    font-family: 'ChicagoFLF', "Chicago", "Geneva", sans-serif;
    font-size: 12px;
}

.modal-titlebar {
    height: 24px;
    background: repeating-linear-gradient(to bottom, #dcdcdc 0px, #dcdcdc 1px, #c0c0c0 1px, #c0c0c0 2px);
    border-bottom: 1px solid #7f7f7f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    padding: 0 8px;
    white-space: nowrap;
}

.modal-body {
    padding: 20px 24px 16px;
    line-height: 1.55;
    color: #111;
    max-height: 58vh;
    overflow-y: auto;
}

.modal-body h3 {
    font-size: 12px;
    text-transform: uppercase;
    margin: 0 0 10px 0;
    letter-spacing: 0.05em;
}

.modal-body p { margin: 0 0 10px 0; }

.modal-footer {
    padding: 12px 18px 14px;
    text-align: right;
    border-top: 1px solid #808080;
}

.modal-footer button {
    min-width: 80px;
    border: 2px solid #000;
    box-shadow: inset -2px -2px 0 #ffffff, inset 2px 2px 0 #808080;
}

/* About window */
.about-window { width: 400px; }

.about-body {
    padding: 20px 24px;
    display: flex;
    gap: 20px;
    align-items: flex-start;
    line-height: 1.45;
}

.about-text { flex: 1; }

/* ==================== NAVIGATION ==================== */
#main-nav {
    background: #d4d0c8;
    border-bottom: 1px solid #808080;
    box-shadow: inset 1px 1px 0 #ffffff;
    padding: 6px 0;
}

#main-nav .content-wrapper {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

#main-nav a {
    color: #000;
    text-decoration: none;
    font-size: 12px;
    padding: 4px 8px;
    white-space: nowrap;
    border: 1px solid transparent;
}

#main-nav a:hover {
    background: #b8d4f8;
    color: #00008b;
    border-color: #808080;
    box-shadow: inset 1px 1px 0 #e0e0e0, inset -1px -1px 0 #606060;
}

#main-nav a:active {
    background: #a4c4e8;
    transform: translate(1px, 1px);
}

/* ==================== STICKIES ==================== */
.section-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin: 30px 0 25px;
    color: #333;
    text-align: center;
    border-bottom: 2px solid #808080;
    padding-bottom: 10px;
}

#stickies-gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px 20px;
}

.sticky-note {
    width: 240px;
    min-height: 200px;
    padding: 15px;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.2);
    border: 1px solid rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.sticky-note:hover {
    transform: scale(1.08);
    z-index: 10;
}

.note-yellow { background: #ffffa5; }
.note-blue   { background: #a5ffff; }
.note-pink   { background: #e66cb5; }
.note-green  { background: #caffca; }
.note-cyan   { background: #30b4f1; }
.note-orange { background: #f78e2d; }
.note-purple { background: #e2caff; }
.note-lime   { background: #f5d833; }

/* ==================== FAQ ==================== */
.faq-container {
    max-width: 700px;
    margin: 20px auto;
    background: #d4d0c8;
    border: 1px solid #808080;
    box-shadow: inset 1px 1px 0 #ffffff, inset -1px -1px 0 #808080;
    padding: 10px 15px;
    font-size: 12px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .sticky-note { width: 180px; min-height: 180px; }
}

@media (max-width: 480px) {
    #top-bar { flex-direction: column; gap: 8px; padding: 8px; }
    #main-nav .content-wrapper { flex-direction: column; gap: 5px; }
    #main-nav a { width: 80%; max-width: 250px; text-align: center; }
    .sticky-note { width: 100%; max-width: 300px; }
}
/* ==================== MAC OS 8 TAB STRIP ==================== */

.tab-strip {
    display: flex;
    align-items: flex-end;
    padding: 4px 6px 0 6px;
    background: var(--platinum-bg);
    gap: 0;
    /* Single 1px black shelf line — tabs sit on top of this */
    border-bottom: 1px solid var(--platinum-black);
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: none;
}
.tab-strip::-webkit-scrollbar { display: none; }

.tab-btn {
    position: relative;
    padding: 2px 14px 3px 14px;
    font-size: 11px;
    font-family: 'ChicagoFLF', "Chicago", "Geneva", sans-serif;
    color: var(--platinum-black);
    cursor: pointer;
    background: var(--platinum-bg);
    /* Reset the global button bevel */
    box-shadow: none;
    border-radius: 0;
    /* Flat single 1px black border on top and sides only — no bevel, no outline trick */
    border-top:    1px solid var(--platinum-black);
    border-left:   1px solid var(--platinum-black);
    border-right:  1px solid var(--platinum-black);
    border-bottom: none;
    /* Inactive tabs sit 2px lower so active tab appears taller */
    margin-bottom: -1px;
    margin-top: 2px;
    margin-right: 3px;
    z-index: 1;
    white-space: nowrap;
    user-select: none;
    height: 22px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 0.01em;
    -webkit-appearance: none;
    appearance: none;
}

.tab-btn:hover:not(.tab-active) {
    background: #b8b8b8;
}

.tab-btn:active {
    box-shadow: none;
    transform: none;
}

/* Active tab: same height shelf, bottom border erased so it bleeds into content */
.tab-btn.tab-active {
    background: var(--inner-bg);
    box-shadow: none;
    border-top:    1px solid var(--platinum-black);
    border-left:   1px solid var(--platinum-black);
    border-right:  1px solid var(--platinum-black);
    /* Erase the shelf line under this tab — connects tab to panel visually */
    border-bottom: 1px solid var(--inner-bg);
    z-index: 3;
    height: 25px;
    margin-top: 0;
    margin-bottom: -1px;
    cursor: default;
}

/* Tab panels — all hidden by default */
.tab-panel {
    display: none;
}
.tab-panel.tab-panel-active {
    display: block;
}

/* ==================== TOOL-SPECIFIC PANEL STYLES ==================== */

/* Sortable file list used by Merge and Image→PDF */
.tool-file-list {
    background: #c8c4bc;
    border-top:    1px solid var(--platinum-dark);
    border-left:   1px solid var(--platinum-dark);
    border-bottom: 1px solid var(--platinum-light);
    border-right:  1px solid var(--platinum-light);
    min-height: 56px;
    max-height: 140px;
    overflow-y: auto;
    margin: 10px 0;
    padding: 4px 6px;
    font-size: 11px;
}

.tool-file-list .file-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 4px;
    cursor: grab;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    color: #111;
    font-size: 11px;
}
.tool-file-list .file-item:last-child { border-bottom: none; }
.tool-file-list .file-item:hover { background: #b8d4f0; }
.tool-file-list .file-item.sortable-ghost { opacity: 0.4; background: #b8d4f0; }

.tool-file-list .file-handle {
    color: #777;
    font-size: 10px;
    cursor: grab;
    flex-shrink: 0;
    line-height: 1;
}

.tool-file-list .file-remove {
    margin-left: auto;
    color: #880000;
    cursor: pointer;
    font-size: 10px;
    flex-shrink: 0;
    border: none;
    background: none;
    font-family: inherit;
    padding: 0 2px;
    box-shadow: none;
    min-width: 0;
}
.tool-file-list .file-remove:active {
    transform: none;
}

.tool-empty-hint {
    color: #888;
    font-size: 10px;
    font-style: italic;
    text-align: center;
    padding: 12px 0 8px;
}

/* Split page range input */
.tool-range-input {
    width: 100%;
    font-family: 'ChicagoFLF', "Chicago", "Geneva", monospace;
    font-size: 11px;
    padding: 4px 7px;
    background: #fff;
    border-top:    1px solid var(--platinum-dark);
    border-left:   1px solid var(--platinum-dark);
    border-bottom: 1px solid var(--platinum-light);
    border-right:  1px solid var(--platinum-light);
    outline: none;
    color: #111;
    box-sizing: border-box;
}
.tool-range-input:focus {
    background: #fffff0;
}

/* Status/hint bar below buttons in each tool */
.tool-status {
    font-size: 10px;
    color: #555;
    font-style: italic;
    margin-top: 8px;
    min-height: 14px;
    text-align: center;
}
.tool-status.error   { color: #880000; font-style: normal; font-weight: bold; }
.tool-status.success { color: #006600; font-style: normal; font-weight: bold; }
.tool-status.working { color: #000080; font-style: normal; }

/* Row layout for tool controls */
.tool-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.tool-label {
    font-size: 11px;
    color: #111;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Split options row */
.split-options {
    display: flex;
    gap: 16px;
    margin: 8px 0;
    font-size: 11px;
    align-items: center;
    flex-wrap: wrap;
}
.split-options label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

/* ==================== RESPONSIVE — TAB STRIP ==================== */
@media (max-width: 520px) {
    .tab-btn {
        padding: 3px 8px 4px 8px;
        font-size: 10px;
    }
    .tab-btn .tab-icon { display: none; }
}