/* D64 Disk Image Index - Blue Terminal Styling */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;700&display=swap');

/* C64 Pro Mono Font */
@font-face {
    font-family: 'C64 Pro Mono';
    src: url('../fonts/C64_Pro_Mono-STYLE.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'C64 Pro';
    src: url('../fonts/C64_Pro-STYLE.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    font-family: 'C64 Pro Mono', monospace;
    font-size: 14px;

    /* box-sizing: border-box; */
}

body {
    background-color: #000000;
    color: #4488ff;
    font-family: 'C64 Pro Mono', 'Courier New', monospace;
    font-size: 15px;
    /* line-height: 1.4; */
    overflow-x: auto;
    overflow-y: auto; /* ensure vertical scroll if content grows */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.ascii-header {
    text-align: center;
    margin-bottom: 30px;
    color: #6699ff;
    font-size: 16px;
    line-height: 1.2;
}

.ascii-header pre {
    color: #6699ff;
    letter-spacing: 0;
    word-spacing: 0;
}

.menu {
    text-align: center;
    margin-bottom: 30px;
    padding: 10px 0;
    border-top: 1px solid #4488ff;
    border-bottom: 1px solid #4488ff;
}

.menu a {
    color: #88aaff;
    text-decoration: none;
    margin: 0 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.menu a:hover {
    color: #ffffff;
    text-decoration: underline;
}
.menu a.active {
    color: #ffffff;
    background-color: #4488ff;
    padding: 2px 6px;
    border-radius: 2px;
}

.content {
    margin-bottom: 40px;
}

.welcome-message {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #4488ff;
    background-color: #001122;
}

.welcome-message h1 {
    color: #6699ff;
    margin-bottom: 15px;
    font-size: 24px;
    text-transform: uppercase;
}

.welcome-message p {
    line-height: 1.6;
    color: #88aaff;
}

/* Search Form */
.search-form {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #4488ff;
    background-color: #001122;
}

.search-form h2 {
    color: #6699ff;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #88aaff;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px;
    background-color: #000000;
    border: 1px solid #4488ff;
    color: #4488ff;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="email"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #6699ff;
    background-color: #001122;
}

.btn {
    background-color: #4488ff;
    color: #000000;
    border: none;
    padding: 11px 22px;
    cursor: pointer;
    font-weight: bold;
    text-transform: uppercase;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background-color: #6699ff;
    border-color: #6699ff;
    color: #000;
}

.btn.btn-secondary {
    background-color: #666;
    border-color: #666;
    color: #fff;
}

.btn.btn-secondary:hover {
    background-color: #888;
    border-color: #888;
    color: #fff;
}

/* Disk Results */
.disk-results {
    margin-bottom: 30px;
}

.disk-results h2 {
    color: #6699ff;
    margin-bottom: 20px;
    text-transform: uppercase;
}

.disk-item {
    margin-bottom: 15px;
    padding: 15px;
    border: 1px solid #4488ff;
    background-color: #001122;
}

.disk-item h3 {
    color: #88aaff;
    margin-bottom: 5px;
    font-family: 'C64 Pro Mono', 'IBM Plex Mono', monospace;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 18px;
}

.disk-item h3 a {
    color: #88aaff;
    text-decoration: none;
    font-family: 'C64 Pro Mono', 'IBM Plex Mono', monospace;
}

.disk-item h3 a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.disk-meta {
    color: #6699ff;
    font-size: 12px;
    margin-bottom: 10px;
}

.disk-description {
    color: #4488ff;
    line-height: 1.4;
}

/* Single Disk View */
.disk-details {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #4488ff;
    background-color: #001122;
}

.disk-details h1 {
    color: #6699ff;
    margin-bottom: 15px;
    text-transform: uppercase;
    font-family: 'C64 Pro Mono', 'IBM Plex Mono', monospace;
    letter-spacing: -1px;
    font-size: 28px;
}

.disk-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.info-group {
    border: 1px solid #4488ff;
    padding: 15px;
    background-color: #000000;
}

.info-group h3 {
    color: #88aaff;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.info-group p {
    color: #4488ff;
    margin-bottom: 5px;
}

/* File List */
.file-list {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #4488ff;
    background-color: #001122;
}

.file-list h2 {
    color: #6699ff;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.file-table {
    width: 100%;
    border-collapse: collapse;
}

.file-table th,
.file-table td {
    /* padding: 8px; */
    text-align: left;
    /* border: 1px solid #4488ff; */
}

.file-table th {
    background-color: #4488ff;
    color: #000000;
    font-weight: bold;
    text-transform: uppercase;
}

.file-table td {
    color: #88aaff;
}

/* C64 font for filename and type columns */
.file-table td:nth-child(1) {
    font-family: 'C64 Pro Mono', 'IBM Plex Mono', monospace;
    /* letter-spacing: 0.5px; */
    font-size: 16px;
}

.file-table td:nth-child(2) {
    font-family: 'C64 Pro Mono', 'IBM Plex Mono', monospace;
    letter-spacing: 0.5px;
    font-size: 16px;
}

.file-table tr:nth-child(even) {
    background-color: #001122;
}

/* Messages */
.message {
    padding: 10px;
    margin-bottom: 20px;
    border: 1px solid;
    font-weight: bold;
}

.message.success {
    background-color: #002200;
    border-color: #4488ff;
    color: #88aaff;
}

.message.error {
    background-color: #220000;
    border-color: #ff4444;
    color: #ff8888;
}

/* Admin Styles */
.admin-panel {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #4488ff;
    background-color: #001122;
}

.admin-panel h2 {
    color: #6699ff;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.admin-actions {
    margin-bottom: 20px;
}

.admin-actions .btn {
    margin-right: 10px;
    margin-bottom: 10px;
}

/* Admin Users Grid (blue theme, shaped like games admin) */
.table-wrapper {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid #4488ff;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    color: #88aaff;
}

.data-table th {
    background: rgba(68, 136, 255, 0.15);
    padding: 14px 12px;
    text-align: left;
    font-weight: bold;
    border-bottom: 1px solid #4488ff;
    color: #6699ff;
    text-transform: uppercase;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid rgba(68, 136, 255, 0.35);
}

.data-table tr:hover {
    background: rgba(68, 136, 255, 0.10);
}

.actions { white-space: nowrap; }

.add-btn {
    background: #4488ff;
    color: #000000;
    border: none;
    padding: 10px 18px;
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}
.add-btn:hover { background: #6699ff; transform: translateY(-1px); }

.edit-btn, .delete-btn {
    padding: 8px 14px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    margin-right: 8px;
    transition: all 0.2s ease;
}

.edit-btn { background: #4CAF50; color: #ffffff; }
.edit-btn:hover { background: #45a049; transform: translateY(-1px); }

.delete-btn { background: #f44336; color: #ffffff; }
.delete-btn:hover { background: #da190b; transform: translateY(-1px); }

/* Upload Form */
.upload-form {
    margin-bottom: 30px;
    padding: 20px;
    border: 1px solid #4488ff;
    background-color: #001122;
}

.upload-form h2 {
    color: #6699ff;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.form-group input[type="file"] {
    width: 100%;
    padding: 8px;
    background-color: #000000;
    border: 1px solid #4488ff;
    color: #4488ff;
    font-family: 'IBM Plex Mono', monospace;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid #4488ff;
    color: #6699ff;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .disk-info {
        grid-template-columns: 1fr;
    }
    
    .menu a {
        display: block;
        margin: 5px 0;
    }
    
    .file-table {
        font-size: 12px;
    }
}

/* D64 Preview Styles with C64 Pro Mono Font */
.d64-preview {
    font-family: 'C64 Pro Mono', monospace;
    background-color: #001122;
    border: 1px solid #4488ff;
    padding: 15px;
    margin: 10px 0;
}

.d64-preview h3 {
    font-family: 'C64 Pro Mono', monospace;
    color: #6699ff;
    font-size: 16px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Disk title and ID with C64 styling */
.d64-disk-title {
    font-family: 'C64 Pro Mono', monospace;
    color: #88aaff;
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.d64-disk-id {
    font-family: 'C64 Pro Mono', monospace;
    color: #6699ff;
    font-size: 16px;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

/* File listings with C64 font */
.d64-file-list {
    margin: 15px 0;
}

.d64-file-item {
    font-family: 'C64 Pro Mono', monospace;
    color: #88aaff;
    font-size: 13px;
    line-height: 1.3;
    margin-bottom: 2px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.d64-filename {
    font-family: 'C64 Pro Mono', monospace;
    color: #88aaff;
    flex: 1;
    letter-spacing: 0.5px;
    font-size: 16px;
}

.d64-filetype {
    font-family: 'C64 Pro Mono', monospace;
    color: #6699ff;
    margin-left: 10px;
    min-width: 60px;
    text-align: right;
    letter-spacing: 0.5px;
    font-size: 16px;
}

.d64-filesize {
    font-family: 'C64 Pro Mono', monospace;
    color: #4488ff;
    margin-left: 10px;
    min-width: 80px;
    text-align: right;
    font-size: 14px;
}

/* Stats section */
.d64-stats {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #4488ff;
    font-family: 'C64 Pro Mono', 'IBM Plex Mono', monospace;
    color: #6699ff;
    font-size: 12px;
}

.d64-stats span {
    margin-right: 15px;
}

/* Special effects for locked/splat files */
.d64-filename.locked {
    color: #ffaa44;
}

.d64-filename.splat {
    color: #ff6666;
}

.d64-filetype.locked {
    color: #ffaa44;
}

.d64-filetype.splat {
    color: #ff6666;
}

/* Match type indicators */
.match-type {
    font-weight: bold;
    padding: 2px 4px;
    border-radius: 2px;
    font-size: 12px;
}

.match-title {
    color: #88ff88;
    background-color: rgba(136, 255, 136, 0.1);
}

.match-disk_id {
    color: #ffaa44;
    background-color: rgba(255, 170, 68, 0.1);
}

.match-collection {
    color: #ff88ff;
    background-color: rgba(255, 136, 255, 0.1);
}

.match-description {
    color: #44aaff;
    background-color: rgba(68, 170, 255, 0.1);
}

.match-filename {
    color: #ffff44;
    background-color: rgba(255, 255, 68, 0.1);
}

/* Pagination styles */
.pagination {
    margin-top: 30px;
    padding: 20px 0;
    border-top: 1px solid #333;
    text-align: center;
}

.pagination-info {
    margin-bottom: 15px;
    color: #4488ff;
    font-size: 14px;
}

.pagination-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.pagination-links .btn {
    min-width: 40px;
    padding: 8px 12px;
    margin: 2px;
    font-size: 12px;
    text-align: center;
}

.pagination-links .btn.current {
    background-color: #6699ff;
    color: #000;
    border-color: #6699ff;
}

.pagination-links .btn.current:hover {
    background-color: #6699ff;
    color: #000;
}

/* Disk stats */
.disk-stats {
    margin-top: 10px;
    font-size: 12px;
    color: #666;
}

/* Responsive pagination */
@media (max-width: 600px) {
    .pagination-links {
        font-size: 12px;
    }
    
    .pagination-links .btn {
        padding: 6px 8px;
        min-width: 35px;
        font-size: 11px;
    }
}

/* Upload tabs styling */
.upload-tabs {
    margin-top: 20px;
}

.tab-buttons {
    display: flex;
    gap: 5px;
    margin-bottom: 30px;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
}

.tab-button {
    padding: 10px 20px;
    background-color: #222;
    color: #4488ff;
    border: 1px solid #333;
    cursor: pointer;
    font-family: 'C64 Pro Mono', 'Courier New', monospace;
    font-size: 14px;
    transition: all 0.3s ease;
}

.tab-button:hover {
    background-color: #333;
    color: #6699ff;
}

.tab-button.active {
    background-color: #4488ff;
    color: #000;
    border-color: #4488ff;
}

.upload-tab {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.upload-tab.active {
    display: block;
}

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

/* ZIP upload specific styling */
#zip-upload h3 {
    color: #ffaa44;
    margin-bottom: 15px;
}

#zip-upload p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Upload progress styling */
.upload-progress {
    margin-top: 20px;
    padding: 15px;
    background-color: #222;
    border: 1px solid #4488ff;
    border-radius: 4px;
    color: #4488ff;
    font-family: 'C64 Pro Mono', 'Courier New', monospace;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { border-color: #4488ff; }
    50% { border-color: #6699ff; }
    100% { border-color: #4488ff; }
}

/* Upload form improvements */
.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

/* Modal styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    animation: modalFadeIn 0.3s ease;
}

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

.modal-content {
    background-color: #111;
    margin: 5% auto;
    padding: 0;
    border: 2px solid #4488ff;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    border-radius: 4px;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    background-color: #4488ff;
    color: #000;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-family: 'C64 Pro Mono', 'Courier New', monospace;
    font-size: 18px;
}

.modal-close {
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #000;
    line-height: 1;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
    color: #4488ff;
}

.modal-footer {
    background-color: #222;
    padding: 15px 20px;
    text-align: right;
    border-top: 1px solid #333;
}

/* ZIP Progress Modal specific styles */
.zip-summary {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #333;
}

.zip-summary h3 {
    color: #6699ff;
    margin-bottom: 15px;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.stat {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background-color: #222;
    border-radius: 3px;
}

.stat-label {
    color: #888;
}

.stat-value {
    color: #4488ff;
    font-weight: bold;
}

.stat-value.success {
    color: #88ff88;
}

.zip-progress-log {
    margin-bottom: 30px;
}

.zip-progress-log h3 {
    color: #6699ff;
    margin-bottom: 15px;
}

.log-entries {
    background-color: #000;
    border: 1px solid #333;
    border-radius: 3px;
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
    font-family: 'C64 Pro Mono', 'Courier New', monospace;
    font-size: 13px;
}

.log-entry {
    margin-bottom: 5px;
    display: flex;
    align-items: flex-start;
    color: #4488ff;
}

.log-entry.log-success {
    color: #88ff88;
}

.log-entry.log-error {
    color: #ff6666;
}

.log-entry.log-warning {
    color: #ffaa44;
}

.log-time {
    color: #666;
    margin-right: 10px;
    flex-shrink: 0;
    font-size: 11px;
}

.log-message {
    flex: 1;
    word-break: break-word;
}

.log-memory {
    color: #8888ff;
    margin-left: 10px;
    flex-shrink: 0;
    font-size: 10px;
    opacity: 0.8;
    background-color: rgba(136, 136, 255, 0.1);
    padding: 2px 6px;
    border-radius: 2px;
    border: 1px solid rgba(136, 136, 255, 0.3);
}

.zip-ignored-files h3 {
    color: #ffaa44;
    margin-bottom: 15px;
}

.ignored-files-list {
    background-color: #222;
    border: 1px solid #333;
    border-radius: 3px;
    padding: 15px;
    max-height: 200px;
    overflow-y: auto;
}

.ignored-file {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 5px 0;
    border-bottom: 1px solid #333;
    font-size: 14px;
}

.ignored-file:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.file-name {
    color: #4488ff;
    font-family: 'C64 Pro Mono', 'Courier New', monospace;
}

.file-reason {
    color: #888;
    font-size: 12px;
    font-style: italic;
}

/* Responsive modal */
@media (max-width: 600px) {
    .modal-content {
        width: 95%;
        margin: 2% auto;
    }
    
    .summary-stats {
        grid-template-columns: 1fr;
    }
    
    .stat {
        flex-direction: column;
        gap: 5px;
    }
    
    .ignored-file {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* Recently Viewed Disks */
.recent-views {
    margin-top: 15px;
}

.recent-item {
    padding: 8px 0;
    border-bottom: 1px solid #334466;
}

.recent-item:last-child {
    border-bottom: none;
}

.recent-title {
    margin-bottom: 4px;
}

.recent-title a {
    color: #88aaff;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
}

.recent-title a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.recent-meta {
    font-size: 11px;
    color: #6699cc;
    font-family: 'IBM Plex Mono', monospace;
}

/* =============================
   Disk view specific styles (migrated from disk.php inline <style>)
   ============================= */
.c64-filename {
    font-family: 'C64 Pro Mono', 'Courier New', monospace;
    font-size: 14px;
    letter-spacing: 0;
}

.bam-cell {
    transition: all 0.3s ease;
}
.bam-cell.highlighted {
    border: 2px solid #ffffff !important;
    box-shadow: 0 0 8px #ffffff;
    transform: scale(1.1);
}
.bam-cell.active {
    border: 2px solid #ffff00 !important;
    box-shadow: 0 0 6px #ffff00;
    background-color: #ffff0044 !important;
}

.file-highlight-info {
    background-color: #000066;
    border: 1px solid #4488ff;
    color: #ffffff;
    padding: 8px;
    margin: 10px 0;
    font-family: monospace;
    font-size: 12px;
    display: none;
}

.hex-link { transition: all 0.2s ease; }
.hex-link:hover {
    color: #ffffff !important;
    background-color: #ffff0033;
    padding: 1px 2px;
    margin: -1px -2px;
    border-radius: 2px;
}

.c64-directory {
    font-feature-settings: normal;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeSpeed;
}

.c64-file-link {
    display: inline;
    padding: 0 1px;
    transition: all 0.1s ease;
    border-radius: 0;
}
.c64-file-link:hover {
    background-color: #7abfc7 !important;
    color: #403285 !important;
    text-decoration: none !important;
}
/* ============================= */

/* =============================
     BAM visualization (migrated from bam.php inline styles)
     ============================= */
.bam-wrapper { margin: 20px 0; }
.bam-legend { margin-bottom: 15px; font-size: 12px; }
.bam-legend .badge { padding: 2px 6px; margin-right: 10px; display: inline-block; font-weight: normal; letter-spacing: 0; }
.bam-legend .badge-allocated { background-color: #aa0000; color: #ffffff; }
.bam-legend .badge-free { background-color: #00aa00; color: #ffffff; }
.bam-legend .badge-na { background-color: #666666; color: #ffffff; }
.bam-legend .badge-error { background-color: #ffaa00; color: #000000; }
.bam-legend .badge-unknown { background-color: #444444; color: #ffffff; }

.bam-layout { display: flex; gap: 20px; margin: 20px 0; }
.bam-grid-area { flex: 1; }
.bam-grid-scroll { overflow-x: auto; background-color: #000000; border: 1px solid #4488ff; padding: 10px; }
.bam-table { border-collapse: separate; border-spacing: 1px; font-family: monospace; font-size: 11px; }
.bam-table th { background-color: #333333; color: #6699ff; padding: 3px; text-align: center; }
.bam-table th.track-header { min-width: 25px; }
.bam-table th.sector-header { min-width: 20px; }

/* Base BAM cell styling & states */
.bam-cell { width: 20px; height: 20px; padding: 3px; text-align: center; cursor: pointer; transition: all 0.2s ease; }
.bam-cell-allocated { background-color: #aa0000; }
.bam-cell-free { background-color: #00aa00; }
.bam-cell-na { background-color: #666666; cursor: default; }
.bam-cell-error { background-color: #ffaa00; color: #000000; font-weight: bold; font-size: 9px; padding: 1px; }

/* Hex dump side panel */
.bam-hex-panel { flex: 0 0 400px; }
.bam-hex-box { background-color: #000000; border: 1px solid #4488ff; padding: 10px; height: 600px; overflow-y: auto; }
.bam-hex-title { color: #6699ff; margin: 0 0 10px 0; font-size: 12px; }
#sectorHexDump { color: #00ff00; font-family: 'Courier New', monospace; font-size: 11px; line-height: 1.2; white-space: pre; }

/* D81 scaling: when wrapper has .d81-mode class reduce sizes for 80x40 grid */
.bam-wrapper.d81-mode .bam-legend { font-size: 10px; }
.bam-wrapper.d81-mode .bam-legend .badge { padding:1px 4px; margin-right:6px; }
.bam-wrapper.d81-mode .bam-table { font-size:9px; }
.bam-wrapper.d81-mode .bam-table th { padding:2px; }
.bam-wrapper.d81-mode .bam-table th.track-header { min-width:20px; }
.bam-wrapper.d81-mode .bam-table th.sector-header { min-width:16px; }
.bam-wrapper.d81-mode .bam-cell { width:14px; height:14px; padding:1px; }
.bam-wrapper.d81-mode .bam-cell-error { font-size:7px; padding:0; }
.bam-wrapper.d81-mode .bam-grid-scroll { padding:6px; }
.bam-wrapper.d81-mode .bam-hex-panel { flex:0 0 340px; }
.bam-wrapper.d81-mode .bam-hex-box { height:520px; }
.bam-wrapper.d81-mode #sectorHexDump { font-size:10px; }

/* Responsive tweak: stack layout on narrow screens */
@media (max-width: 900px) {
    .bam-layout { flex-direction: column; }
    .bam-hex-panel { flex: 1 1 auto; }
}
/* ============================= */

/* =============================
    Collections & Disk cards (migrated from collections.php inline styles)
    ============================= */
.collections-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 30px; }
.collection-card { border: 1px solid #0066cc; background: #001122; padding: 20px; transition: border-color 0.3s ease; }
.collection-card:hover { border-color: #0099ff; }
.collection-header h2 { margin: 0 0 15px 0; color: #0099ff; }
.collection-header h2 a { color: #0099ff; text-decoration: none; }
.collection-header h2 a:hover { color: #ffffff; }
.collection-description { margin: 15px 0; padding: 10px; border-left: 3px solid #0066cc; background: rgba(0, 102, 204, 0.1); }
.collection-stats { margin: 20px 0; font-family: 'IBM Plex Mono', monospace; color: #0099ff; }
.collection-stats .stat { display: inline-block; text-align: center; margin-right: 20px; }
.collection-actions { margin-top: 15px; }
.navigation { margin-bottom: 20px; }
.navigation a { color: #0099ff; text-decoration: none; font-family: 'IBM Plex Mono', monospace; }
.navigation a:hover { color: #ffffff; }
.no-results { text-align: center; margin: 40px 0; color: #6699cc; }
.no-results a { color: #0099ff; text-decoration: none; }
.no-results a:hover { color: #ffffff; }

/* Shared disk grid/card (was inline in browse/collections) */
.disk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin: 20px 0; }
.disk-card { background-color: #000066; border: 1px solid #4488ff; padding: 15px; color: #ffffff; font-family: monospace; font-size: 12px; }
.disk-card { display: flex; flex-direction: column; justify-content: flex-start; position: relative; transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease; }
.disk-card:hover { border-color: #6699ff; transform: translateY(-2px); box-shadow: 0 2px 6px rgba(102,153,255,0.3); }
.disk-grid.disk-tiles { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.disk-card .actions { margin-top: auto; padding-top: 10px; }
.disk-card h3 { color: #6699ff; margin: 0 0 10px 0; font-size: 14px; }
.disk-card h3 a { color: #6699ff; text-decoration: none; }
.disk-card h3 a:hover { color: #ffffff; text-decoration: underline; }
.disk-card p { margin: 5px 0; line-height: 1.3; }
.disk-card .meta { color: #888888; font-size: 11px; margin-top: 10px; padding-top: 10px; border-top: 1px solid #333333; }

@media (max-width: 768px) { .disk-grid { grid-template-columns: 1fr; } }
/* ============================= */

/* =============================
    File view (migrated from file.php inline styles)
    ============================= */
.extract-btn { background-color:#4488ff; color:#fff; padding:8px 16px; border:2px solid #6699ff; cursor:pointer; font-family:'IBM Plex Mono', monospace; font-size:12px; text-transform:uppercase; transition:all .2s; }
.extract-btn:hover:not(:disabled){ background-color:#6699ff; border-color:#88aaff; }
.extract-btn:disabled{ background-color:#333; border-color:#555; cursor:not-allowed; opacity:.7; }

/* Tabs */
.tab-navigation { display:flex; gap:2px; margin-bottom:0; }
.tab-btn { background-color:#333; color:#6699ff; border:1px solid #4488ff; padding:8px 16px; cursor:pointer; font-family:'IBM Plex Mono', monospace; font-size:11px; text-transform:uppercase; transition:all .2s; border-bottom:none; }
.tab-btn:hover { background-color:#444; color:#88aaff; }
.tab-btn.active { background-color:#4488ff; color:#fff; border-color:#4488ff; }
.tab-content { display:none; }
.tab-content.active { display:block; }

/* C64 image preview modal overrides */
.c64-preview-image { cursor:pointer; transition:opacity .2s; }
.c64-preview-image:hover { opacity:.8; }

/* Hex/PETSCII dump containers */
.dump-box { background-color:#000; border:1px solid #4488ff; padding:15px; margin:10px 0; overflow-x:auto; }
.dump-box pre { color:#00ff00; font-family:'Courier New', monospace; font-size:12px; line-height:1.2; margin:0; white-space:pre; }
.dump-box pre.error { color:#ff6666; }

/* MUS play button (reuse .btn base) */
.btn-mus { padding:4px 10px; font-size:11px; }

/* Inline collection edit form inputs to match standard form-group styling */
.inline-edit-form .inline-input {
    background:#000;
    color:#fff;
    border:1px solid #0066cc;
    padding:6px 10px; /* similar vertical rhythm to .btn */
    font-size:12px;
    line-height:1.2;
    height:32px; /* align with most button heights */
    box-sizing:border-box;
    border-radius:2px;
    font-family:inherit;
}
.inline-edit-form .inline-input:focus {
    outline:none;
    border-color:#33aaff;
    box-shadow:0 0 4px rgba(51,170,255,0.4);
}

/* Width utility fallbacks if not defined */
.inline-edit-form .w-160 { width:160px; }
.inline-edit-form .w-220 { width:220px; }

/* Normalize spacing between inputs & buttons */
.inline-edit-form { gap:8px; }

/* Ensure mapping forms (add/remove disk) look consistent */
form.flex-row.gap-10.wrap input[type="number"],
form.flex-row.gap-10.wrap select {
    background:#000;
    color:#fff;
    border:1px solid #0066cc;
    padding:6px 10px;
    font-size:12px;
    height:32px;
    border-radius:2px;
}
form.flex-row.gap-10.wrap input[type="number"]:focus,
form.flex-row.gap-10.wrap select:focus {
    outline:none;
    border-color:#33aaff;
    box-shadow:0 0 4px rgba(51,170,255,0.4);
}
/* ============================= */

/* =============================
    Browse page specific styles
    ============================= */
.browse-controls {
    background-color: #000066;
    border: 1px solid #4488ff;
    color: #ffffff;
    padding: 15px;
    margin: 20px 0;
    font-family: monospace;
}

.browse-controls form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
}

.browse-controls label {
    color: #6699ff;
    font-weight: bold;
}

.browse-controls input, .browse-controls select {
    background-color: #000000;
    border: 1px solid #4488ff;
    color: #ffffff;
    padding: 5px 8px;
    font-family: monospace;
    font-size: 12px;
}

.browse-controls button {
    background-color: #4488ff;
    border: 1px solid #6699ff;
    color: #ffffff;
    padding: 6px 12px;
    cursor: pointer;
    font-family: monospace;
    font-size: 12px;
}

.browse-controls button:hover {
    background-color: #6699ff;
    color: #000000;
}

/* Browse page pagination (different from main pagination) */
.browse-pagination {
    background-color: #000066;
    border: 1px solid #4488ff;
    color: #ffffff;
    padding: 15px;
    margin: 20px 0;
    text-align: center;
    font-family: monospace;
}

.browse-pagination a, .browse-pagination span {
    display: inline-block;
    padding: 5px 10px;
    margin: 2px;
    color: #88aaff;
    text-decoration: none;
    border: 1px solid #4488ff;
    background-color: #000000;
}

.browse-pagination a:hover {
    background-color: #4488ff;
    color: #ffffff;
}

.browse-pagination .current {
    background-color: #6699ff;
    color: #000000;
    font-weight: bold;
}

.browse-pagination .disabled {
    color: #666666;
    border-color: #666666;
}

.results-info {
    color: #6699ff;
    font-family: monospace;
    font-size: 12px;
    margin: 10px 0;
}

@media (max-width: 768px) {
    .browse-controls form {
        flex-direction: column;
        align-items: stretch;
    }
}
/* ============================= */
