/* Phraseology App Styles */

/* CSS Variables */
:root {
    --secondary: #000;
    --primary: #fff;
}

/* Font path fixes for Flask static */
@font-face {
    font-family: Chicago;
    src: url("ChicagoFLF.woff2") format("woff2"),
         url("ChicagoFLF.woff") format("woff");
}
@font-face {
    font-family: Chicago_12;
    src: url("ChiKareGo2.woff2") format("woff2"),
         url("ChiKareGo2.woff") format("woff");
}
@font-face {
    font-family: Geneva_9;
    src: url("FindersKeepers.woff2") format("woff2"),
         url("FindersKeepers.woff") format("woff");
}
@font-face {
    font-family: Monaco;
    src: url("monaco.woff2") format("woff2"),
         url("monaco.woff") format("woff");
}

/* Global font - everything uses Chicago */
html, body {
    font-family: Chicago_12, Chicago, Geneva_9, "Helvetica Neue", sans-serif;
    font-size: 14px;
    line-height: 1.4;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: Chicago, Chicago_12, sans-serif;
}

p, li, label, span, a, td, th {
    font-family: Chicago_12, Geneva_9, sans-serif;
}

code, pre, textarea {
    font-family: Monaco, monospace;
}

/* ============================================
   DESKTOP LAYOUT
   ============================================ */

.desktop-menu-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 1px solid #000;
    font-size: 15px;
}

.desktop-menu-bar > li[role="menu-item"] {
    padding: 3px 10px;
    font-size: 15px;
    line-height: 1.2;
    display: flex;
    align-items: center;
}

.desktop-menu-bar .apple-menu {
    padding: 2px 8px;
}

/* Custom Phraseology icon - magnifying glass over document */
.desktop-menu-bar .apple {
    display: inline-block;
    width: 20px;
    height: 20px;
    vertical-align: middle;
    background: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20'%3E%3Crect x='2' y='1' width='10' height='14' fill='white' stroke='black' stroke-width='1.5'/%3E%3Cline x1='4' y1='4' x2='10' y2='4' stroke='black' stroke-width='1'/%3E%3Cline x1='4' y1='6' x2='10' y2='6' stroke='black' stroke-width='1'/%3E%3Cline x1='4' y1='8' x2='8' y2='8' stroke='black' stroke-width='1'/%3E%3Ccircle cx='13' cy='11' r='4' fill='white' stroke='black' stroke-width='1.5'/%3E%3Cline x1='16' y1='14' x2='18' y2='17' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

/* Large Phraseology icon for About dialog */
.phraseology-icon-large {
    display: inline-block;
    width: 64px;
    height: 64px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 20 20'%3E%3Crect x='2' y='1' width='10' height='14' fill='white' stroke='black' stroke-width='1.5'/%3E%3Cline x1='4' y1='4' x2='10' y2='4' stroke='black' stroke-width='1'/%3E%3Cline x1='4' y1='6' x2='10' y2='6' stroke='black' stroke-width='1'/%3E%3Cline x1='4' y1='8' x2='8' y2='8' stroke='black' stroke-width='1'/%3E%3Ccircle cx='13' cy='11' r='4' fill='white' stroke='black' stroke-width='1.5'/%3E%3Cline x1='16' y1='14' x2='18' y2='17' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.desktop-menu-bar a {
    font-size: 15px;
}

.desktop-menu-bar .user-menu {
    margin-left: auto;
}

.desktop-menu-bar .user-menu ul[role="menu"] {
    left: auto;
    right: 0;
}

.desktop-menu-bar .shortcut {
    float: right;
    opacity: 0.6;
    margin-left: 20px;
}

.desktop {
    position: fixed;
    top: 28px; /* Below menu bar */
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

/* ============================================
   DESKTOP ICONS
   ============================================ */

.desktop-icons {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.trash-icon {
    position: absolute;
    bottom: 20px;
    right: 20px;
}

.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 80px;
    padding: 5px;
    cursor: pointer;
    text-align: center;
}

.desktop-icon:hover {
    background: rgba(0, 0, 0, 0.1);
}

.desktop-icon.selected {
    background: var(--secondary);
    color: var(--primary);
}

.desktop-icon .icon {
    width: 48px;
    height: 48px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin-bottom: 5px;
}

.desktop-icon span {
    font-family: Chicago_12, Geneva_9, sans-serif;
    font-size: 14px;
}

/* Icon images - Classic Mac style */
.icon-document {
    background-image: url("data:image/svg+xml,%3Csvg width='48' height='48' viewBox='0 0 32 32' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 2H20L26 8V30H6V2Z' fill='white' stroke='black' stroke-width='2'/%3E%3Cpath d='M20 2V8H26' fill='white' stroke='black' stroke-width='2'/%3E%3Cline x1='10' y1='14' x2='22' y2='14' stroke='black' stroke-width='2'/%3E%3Cline x1='10' y1='18' x2='22' y2='18' stroke='black' stroke-width='2'/%3E%3Cline x1='10' y1='22' x2='18' y2='22' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
}

.icon-folder {
    background-image: url("data:image/svg+xml,%3Csvg width='48' height='48' viewBox='0 0 32 32' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 6H12L14 10H4V6Z' fill='white' stroke='black' stroke-width='2'/%3E%3Cpath d='M2 10H30V28H2V10Z' fill='white' stroke='black' stroke-width='2'/%3E%3Cpath d='M2 14H30V28H2V14Z' fill='white' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
}

.icon-settings {
    background-image: url("data:image/svg+xml,%3Csvg width='48' height='48' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='4' y='4' width='24' height='24' fill='white' stroke='black' stroke-width='2'/%3E%3Cline x1='8' y1='10' x2='24' y2='10' stroke='black' stroke-width='2'/%3E%3Cline x1='8' y1='16' x2='24' y2='16' stroke='black' stroke-width='2'/%3E%3Cline x1='8' y1='22' x2='24' y2='22' stroke='black' stroke-width='2'/%3E%3Crect x='10' y='8' width='4' height='4' fill='black'/%3E%3Crect x='18' y='14' width='4' height='4' fill='black'/%3E%3Crect x='14' y='20' width='4' height='4' fill='black'/%3E%3C/svg%3E");
}

.icon-trash {
    background-image: url("data:image/svg+xml,%3Csvg width='48' height='48' viewBox='0 0 32 32' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 6H26V10H6V6Z' fill='white' stroke='black' stroke-width='2'/%3E%3Cpath d='M12 4H20V6H12V4Z' fill='white' stroke='black' stroke-width='2'/%3E%3Cpath d='M8 10H24V28C24 28 23 30 16 30C9 30 8 28 8 28V10Z' fill='white' stroke='black' stroke-width='2'/%3E%3Cline x1='12' y1='14' x2='12' y2='26' stroke='black' stroke-width='2'/%3E%3Cline x1='16' y1='14' x2='16' y2='26' stroke='black' stroke-width='2'/%3E%3Cline x1='20' y1='14' x2='20' y2='26' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
}

.icon-trash.full {
    background-image: url("data:image/svg+xml,%3Csvg width='48' height='48' viewBox='0 0 32 32' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 4L14 2L18 5L22 3L20 8H12L10 4Z' fill='%23888' stroke='black' stroke-width='1'/%3E%3Cpath d='M5 7H27L26 11H6L5 7Z' fill='white' stroke='black' stroke-width='2'/%3E%3Cpath d='M8 11H24V28C24 28 23 30 16 30C9 30 8 28 8 28V11Z' fill='white' stroke='black' stroke-width='2'/%3E%3Cline x1='12' y1='15' x2='12' y2='26' stroke='black' stroke-width='2'/%3E%3Cline x1='16' y1='15' x2='16' y2='26' stroke='black' stroke-width='2'/%3E%3Cline x1='20' y1='15' x2='20' y2='26' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
}

.icon-help {
    background-image: url("data:image/svg+xml,%3Csvg width='48' height='48' viewBox='0 0 32 32' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16 28L4 16C1 13 1 8 4 5C7 2 12 2 15 5L16 6L17 5C20 2 25 2 28 5C31 8 31 13 28 16L16 28Z' fill='white' stroke='black' stroke-width='2'/%3E%3Cpath d='M8 8C9 7 11 7 12 8' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
}

/* ============================================
   WINDOWS
   ============================================ */

/* Only desktop windows are absolute positioned */
.desktop .window {
    position: absolute;
}

.window {
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3);
}

.window.active .title-bar {
    background: linear-gradient(var(--secondary) 50%, transparent 50%);
    background-size: 6.6666666667% 13.3333333333%;
    background-clip: content-box;
}

/* Inactive title bar buttons - match system.css .title-bar button styling */
.inactive-title-bar button {
    background-color: #fff;
    border: 4px solid #000;
    cursor: pointer;
    display: block;
    height: 40px;
    margin: 0 .2rem;
    position: relative;
    transform: scale(.5);
    width: 40px;
}

.inactive-title-bar button.close:after,
.inactive-title-bar button.close:before {
    bottom: 0;
    content: "";
    left: 0;
    opacity: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.inactive-title-bar button.resize {
    background: linear-gradient(#000, #000) left 58%, linear-gradient(180deg, #000 0, #000) 58% top;
    background-color: #fff;
    background-repeat: no-repeat;
    background-size: 60% 4px, 4px 60%;
}

/* ============================================
   SCANNER
   ============================================ */

.scanner-form textarea {
    width: 100%;
    min-height: 150px;
    padding: 10px;
    font-family: Monaco, monospace;
    font-size: 16px;
    line-height: 1.1;
    border: 1.5px solid var(--secondary);
    resize: vertical;
    box-sizing: border-box;
}

.scanner-form textarea:focus {
    outline: none;
    background: var(--secondary);
    color: var(--primary);
}

.scan-meta {
    margin: 10px 0;
    font-size: 14px;
    color: #666;
    display: flex;
    justify-content: space-between;
}

.scan-actions {
    margin-top: 15px;
    text-align: right;
}

.file-drop-zone {
    border: 2px dashed var(--secondary);
    padding: 20px;
    text-align: center;
    margin: 15px 0;
    cursor: pointer;
}

.file-drop-zone:hover {
    background: rgba(0, 0, 0, 0.05);
}

.file-drop-zone.drag-over {
    background: rgba(0, 0, 0, 0.1);
    border-color: #000;
    border-style: solid;
}

.file-drop-zone.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.file-drop-zone .small {
    font-size: 11px;
    color: #666;
}

.usage-info {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #ccc;
    font-size: 11px;
    color: #666;
}

/* ============================================
   RESULTS / SCORE DISPLAY
   ============================================ */

.score-display {
    text-align: center;
    padding: 20px 0;
}

.score-circle {
    width: 120px;
    height: 120px;
    border: 4px solid var(--secondary);
    border-radius: 50%;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.score-value {
    font-family: Chicago, Chicago_12;
    font-size: 32px;
    font-weight: bold;
}

.score-label {
    font-family: Chicago_12;
    font-size: 16px;
    margin-top: 5px;
}

.score-human { border-color: #000; }
.score-mixed { border-color: #666; }
.score-ai { border-color: #000; background: #eee; }
.score-error { /* no special styling for error in table */ }

/* Retry prompt for failed scans */
.retry-prompt {
    text-align: center;
    padding: 15px;
    margin: 10px 0;
    background: #f9f9f9;
    border: 1px solid #ccc;
}
.retry-prompt p {
    margin: 0 0 10px 0;
    font-size: 13px;
}

.result-meta {
    text-align: center;
    font-size: 12px;
    color: #666;
}

.result-actions {
    margin-top: 20px;
    text-align: center;
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* Signal Breakdown */
.breakdown-section {
    margin-top: 15px;
}

.breakdown-section h3 {
    font-size: 14px;
    margin-bottom: 10px;
}

.signal-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
}

.signal-name {
    width: 140px;
    flex-shrink: 0;
}

.signal-bar {
    flex: 1;
    height: 12px;
    background: #eee;
    border: 1px solid #000;
    margin: 0 10px;
}

.signal-fill {
    height: 100%;
    background: var(--secondary);
}

.signal-score {
    width: 40px;
    text-align: right;
}

.upgrade-hint {
    text-align: center;
    padding: 15px;
    background: #f5f5f5;
}

.interpretation-section h3,
.text-preview-section h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
}

.interpretation-text {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.text-preview {
    background: #fff;
    border: 1px solid var(--secondary);
    padding: 10px;
    font-family: Monaco, monospace;
    font-size: 12px;
    max-height: 120px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ============================================
   HISTORY
   ============================================ */

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.history-table th {
    text-align: left;
    padding: 8px 5px;
    border-bottom: 2px solid var(--secondary);
    font-family: Chicago_12;
}

.history-table td {
    padding: 8px 5px;
    border-bottom: 1px solid #ccc;
}

.history-row {
    cursor: pointer;
}

.history-row:hover {
    background: rgba(0, 0, 0, 0.05);
}

.history-table .preview {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-table .score {
    font-weight: bold;
}

.history-table .actions {
    text-align: right;
}

.btn-small {
    padding: 2px 8px;
    font-size: 11px;
    min-height: auto;
    min-width: auto;
}

/* Failed scan styles */
.scan-failed {
    background: #fff8f8;
}
.scan-failed:hover {
    background: #ffeeee;
}

.status-icon {
    display: inline-block;
    width: 16px;
    text-align: center;
    margin-right: 4px;
}
.status-error {
    color: #c00;
    font-weight: bold;
}
.status-processing {
    color: #666;
}

.error-badge {
    display: inline-block;
    padding: 1px 6px;
    background: #eee;
    border: 1px solid #ccc;
    font-size: 10px;
    font-weight: normal;
}

.btn-retry {
    margin-right: 5px;
}

.htmx-indicator {
    display: none;
}
.htmx-request .htmx-indicator {
    display: inline;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-state .icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 15px;
    opacity: 0.5;
}

/* ============================================
   SETTINGS
   ============================================ */

.settings-tabs {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 15px;
}

.settings-tabs label {
    margin-right: 15px;
}

.settings-tabs label:last-child {
    margin-right: 0;
}

.settings-panel {
    min-height: 200px;
}

.settings-panel h3 {
    font-size: 14px;
    margin: 15px 0 10px;
}

/* ============================================
   AUTH PAGES
   ============================================ */

.auth-background {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-dialog {
    width: 100%;
    max-width: 400px;
}

.auth-dialog .modal-contents {
    padding: 30px;
}

.error {
    color: #c00;
    font-size: 12px;
    margin: -10px 0 10px 88px;
}

/* Inline validation errors (client-side) */
.error[id] {
    margin: -5px 0 10px 88px;
}

.alert {
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid;
}

.alert-error {
    background: #fee;
    border-color: #c00;
}

.alert-success {
    background: #efe;
    border-color: #0a0;
}

.alert-info {
    background: #eef;
    border-color: #00a;
}

/* ============================================
   LANDING PAGE
   ============================================ */

.landing-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

.hero {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-bottom: 60px;
    flex-wrap: wrap;
}

.hero-content {
    flex: 1;
    min-width: 300px;
}

.hero h1 {
    font-family: Chicago;
    font-size: 48px;
    margin-bottom: 10px;
}

.hero .tagline {
    font-size: 24px;
    margin-bottom: 15px;
}

.hero .description {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 25px;
}

.hero-actions {
    display: flex;
    gap: 15px;
}

.hero-screenshot {
    flex-shrink: 0;
}

/* Hide demo on smaller screens to prevent overflow */
@media (max-width: 900px) {
    .hero-screenshot {
        display: none;
    }

    .hero {
        justify-content: center;
        text-align: center;
    }

    .hero-actions {
        justify-content: center;
    }
}

.demo-window {
    pointer-events: none;
}

.demo-score {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.features {
    margin-bottom: 60px;
}

.features h2 {
    text-align: center;
    margin-bottom: 30px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.feature {
    text-align: center;
    padding: 20px;
}

.feature h3 {
    margin-bottom: 10px;
}

/* ============================================
   PRICING PAGE
   ============================================ */

.pricing-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

.pricing-header {
    text-align: center;
    margin-bottom: 40px;
}

.pricing-header h1 {
    font-family: Chicago;
    font-size: 32px;
    margin-bottom: 10px;
}

.pricing-table {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
    align-items: stretch;
}

.pricing-card {
    padding: 25px;
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
}

.pricing-card.featured {
    border-width: 3px;
}

.pricing-card .badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    padding: 4px 12px;
    font-size: 12px;
    font-family: Chicago_12, sans-serif;
}

.pricing-card .features-list {
    flex: 1;
}

.pricing-card .btn {
    margin-top: auto;
}

.pricing-card h2 {
    font-size: 20px;
    margin-bottom: 10px;
}

.pricing-card .price {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 20px;
}

.pricing-card .price span {
    font-size: 14px;
    font-weight: normal;
}

.features-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    text-align: left;
}

.features-list li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

.features-list li::before {
    content: '✓ ';
}

.pricing-footer {
    text-align: center;
}

.pricing-preview {
    margin-bottom: 60px;
}

.pricing-preview h2 {
    text-align: center;
    margin-bottom: 30px;
}

.pricing-grid {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.pricing-grid .pricing-card {
    width: 250px;
}

.pricing-grid .pricing-card ul {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    text-align: left;
}

.pricing-grid .pricing-card li {
    padding: 5px 0;
    font-size: 13px;
}

.landing-footer {
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid #ccc;
    color: #666;
}

/* ============================================
   FLOATING ALERTS
   ============================================ */

.floating-alert {
    animation: slideIn 0.2s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .hero {
        flex-direction: column;
    }

    .hero-screenshot {
        display: none;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .pricing-table {
        grid-template-columns: 1fr;
    }

    .desktop-icons {
        position: fixed;
        bottom: 0;
        top: auto;
        left: 0;
        right: 0;
        flex-direction: row;
        justify-content: space-around;
        background: var(--primary);
        border-top: 1px solid var(--secondary);
        padding: 10px;
        z-index: 100;
    }

    .trash-icon {
        display: none;
    }
}

/* ============================================
   LOADING STATES & PROGRESS
   ============================================ */

/* Classic Mac watch cursor */
.loading,
.loading * {
    cursor: wait !important;
}

/* Indeterminate progress bar (barber pole) */
.progress-bar {
    height: 16px;
    border: 2px solid var(--secondary);
    background: var(--primary);
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: var(--secondary);
    transition: width 0.3s ease;
}

.progress-bar.indeterminate .progress-bar-fill {
    width: 30%;
    animation: indeterminate 1.5s ease-in-out infinite;
}

@keyframes indeterminate {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

/* Barber pole style (classic Mac) */
.progress-bar.barber-pole {
    background: repeating-linear-gradient(
        -45deg,
        var(--primary),
        var(--primary) 8px,
        var(--secondary) 8px,
        var(--secondary) 16px
    );
    background-size: 32px 100%;
    animation: barber-pole 0.5s linear infinite;
}

@keyframes barber-pole {
    0% { background-position: 0 0; }
    100% { background-position: 32px 0; }
}

/* Spinner (classic Mac style) */
.spinner {
    width: 20px;
    height: 20px;
    display: inline-block;
    position: relative;
}

.spinner::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border: 2px solid var(--secondary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Loading overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loading-overlay .spinner {
    width: 32px;
    height: 32px;
    margin-bottom: 10px;
}

.loading-text {
    font-family: Chicago_12, Geneva_9, sans-serif;
    font-size: 12px;
}

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
    background-size: 200% 100%;
    animation: skeleton 1.5s ease-in-out infinite;
    border-radius: 2px;
}

@keyframes skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.skeleton-text:last-child {
    width: 60%;
}

/* ============================================
   WELCOME SPLASH
   ============================================ */

.splash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.splash-window {
    width: 450px;
    max-height: 80vh;
    animation: slideUp 0.3s ease;
}

.splash-window .window-pane {
    overflow-y: auto;
    max-height: calc(80vh - 30px);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.splash-content {
    text-align: center;
    padding: 15px 20px;
}

.splash-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 10px;
}

.splash-title {
    font-family: Chicago, Chicago_12, sans-serif;
    font-size: 24px;
    margin-bottom: 10px;
}

.splash-version {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}

.splash-features {
    text-align: left;
    margin: 10px 0;
    padding: 10px;
    background: #f5f5f5;
    border: 1px solid #ccc;
}

.splash-features h3 {
    font-size: 14px;
    margin-bottom: 10px;
}

.splash-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.splash-features li {
    padding: 3px 0;
    font-size: 13px;
}

.splash-features li::before {
    content: '• ';
}

.splash-actions {
    margin-top: 12px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.splash-checkbox {
    margin-top: 8px;
    margin-bottom: 10px;
    font-size: 12px;
}

.splash-checkbox label {
    position: relative;
    top: 2px;
}

/* ============================================
   PIXEL ART ICONS (SVG-based)
   ============================================ */

.icon-scanner {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect x='4' y='4' width='24' height='24' fill='white' stroke='black' stroke-width='2'/%3E%3Crect x='8' y='8' width='16' height='2' fill='black'/%3E%3Crect x='8' y='12' width='14' height='2' fill='black'/%3E%3Crect x='8' y='16' width='16' height='2' fill='black'/%3E%3Crect x='8' y='20' width='10' height='2' fill='black'/%3E%3C/svg%3E");
}

.icon-history {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect x='2' y='4' width='20' height='24' fill='white' stroke='black' stroke-width='2'/%3E%3Crect x='10' y='8' width='20' height='24' fill='white' stroke='black' stroke-width='2'/%3E%3Crect x='14' y='12' width='12' height='2' fill='black'/%3E%3Crect x='14' y='16' width='10' height='2' fill='black'/%3E%3Crect x='14' y='20' width='12' height='2' fill='black'/%3E%3Crect x='14' y='24' width='8' height='2' fill='black'/%3E%3C/svg%3E");
}

.icon-gear {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cpath d='M14 2h4v4h4v4h4v4h-4v4h-4v4h-4v-4H10v-4H6v-4h4V6h4V2z' fill='white' stroke='black' stroke-width='2'/%3E%3Ccircle cx='16' cy='16' r='4' fill='white' stroke='black' stroke-width='2'/%3E%3C/svg%3E");
}

.icon-trash-can {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect x='8' y='8' width='16' height='20' fill='white' stroke='black' stroke-width='2' rx='0'/%3E%3Crect x='6' y='4' width='20' height='4' fill='white' stroke='black' stroke-width='2'/%3E%3Crect x='12' y='2' width='8' height='4' fill='white' stroke='black' stroke-width='2'/%3E%3Crect x='11' y='12' width='2' height='12' fill='black'/%3E%3Crect x='15' y='12' width='2' height='12' fill='black'/%3E%3Crect x='19' y='12' width='2' height='12' fill='black'/%3E%3C/svg%3E");
}

.icon-about {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='16' r='14' fill='white' stroke='black' stroke-width='2'/%3E%3Crect x='14' y='8' width='4' height='4' fill='black'/%3E%3Crect x='14' y='14' width='4' height='12' fill='black'/%3E%3C/svg%3E");
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 15px;
}

.pagination a,
.pagination span {
    padding: 4px 10px;
    border: 1px solid var(--secondary);
    text-decoration: none;
    font-size: 12px;
}

.pagination a:hover {
    background: #f0f0f0;
}

.pagination .current {
    background: var(--secondary);
    color: var(--primary);
}

/* ============================================
   SCANNING LOADING OVERLAY
   ============================================ */

.scanning-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.scanning-dialog {
    background: #fff;
    border: 2px solid #000;
    box-shadow: 2px 2px 0 #000;
    padding: 20px 30px;
    text-align: center;
    min-width: 280px;
}

.scanning-dialog h3 {
    margin: 0 0 15px 0;
    font-size: 14px;
}

.scanning-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 15px;
    animation: scan-pulse 1s ease-in-out infinite;
}

@keyframes scan-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.scanning-progress {
    width: 200px;
    height: 16px;
    border: 2px solid #000;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.scanning-progress-fill {
    height: 100%;
    width: 30%;
    background: repeating-linear-gradient(
        -45deg,
        #000,
        #000 8px,
        #fff 8px,
        #fff 16px
    );
    animation: scan-slide 0.8s linear infinite;
}

@keyframes scan-slide {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

.scanning-text {
    margin-top: 12px;
    font-size: 12px;
    color: #666;
}
