header.header-layout {
    display: flex !important;
    align-items: center;
    text-align: left !important;
    width: auto;
    min-width: 0;
}

.header-gif {
    width: 64px;
    height: 81px;
    margin-right: 16px;
    flex-shrink: 0;
    transform: translate(-6px, -8px);
}

.header-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.header-text h1 {
    margin: 0 0 4px 0;
}

.header-text p {
    margin: 0;
}

/* Windows 98 Theme - Clean Implementation using 98.css */

/* Basic layout */
body {
    background: #c0c0c0 url('desktop-background.jpg') no-repeat left center fixed;
    background-size: cover;
    margin: 0;
    padding: 10px;
    font-family: 'MS Sans Serif', sans-serif;
    font-size: 11px;
    position: relative;
}

.zoom-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
    display: flex;
    align-items: center;
    gap: 6px;
}

.zoom-controls button {
    font-size: 24px !important;
    width: 36px !important;
    height: 36px !important;
    margin: 0 !important;
    border: 2px solid #808080 !important;
    border-top: 2px solid #dfdfdf !important;
    border-left: 2px solid #dfdfdf !important;
    border-right: 2px solid #808080 !important;
    border-bottom: 2px solid #808080 !important;
    background: #c0c0c0 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
}

.zoom-controls button:active {
    border: 2px solid #c0c0c0;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #dfdfdf;
    border-bottom: 2px solid #dfdfdf;
}

.zoom-icon {
    width: 32px;
    height: 32px;
    image-rendering: -moz-crisp-edges !important;
    image-rendering: -webkit-crisp-edges !important;
    image-rendering: pixelated !important;
    image-rendering: crisp-edges !important;
    image-rendering: -webkit-optimize-contrast !important;
    -ms-interpolation-mode: nearest-neighbor !important;
}

/* Bottom right decoration GIF */
body::after {
    content: '';
    position: fixed;
    bottom: -8px;
    right: -16px;
    width: 63px;
    height: 144px;
    background: url('bottom-right-decoration.gif') no-repeat;
    background-size: 63px 144px;
    z-index: 1000;
    pointer-events: none;
    /* Pixel-perfect rendering for background GIF */
    image-rendering: -moz-crisp-edges !important;
    image-rendering: -webkit-crisp-edges !important;
    image-rendering: pixelated !important;
    image-rendering: crisp-edges !important;
    image-rendering: -webkit-optimize-contrast !important;
    -ms-interpolation-mode: nearest-neighbor !important;
}

#app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    text-align: center;
}

/* Make URL input window match column width */
#url-input-section {
    /* Default: full width on small screens */
    width: 100%;
    max-width: 750px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 20px;
    padding: 11.5px 23px;
    background: rgba(192, 192, 192, 0.9);
    border: 2px outset #c0c0c0;
    display: inline-block;
}

/* Override for header-layout */
header.header-layout {
    display: inline-flex !important;
    width: auto !important;
}

header h1 {
    font-size: 20.7px;
    font-weight: bold;
    margin: 0 0 11.5px 0;
    color: #000;
}

header p {
    font-size: 12.65px;
    margin: 0;
    color: #000;
}

/* Main content */
main {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

/* Windows 98 Window Structure */
.window {
    background: rgba(192, 192, 192, 0.95);
    border: 2px solid #c0c0c0;
    border-top: 2px solid #dfdfdf;
    border-left: 2px solid #dfdfdf;
    border-right: 2px solid #808080;
    border-bottom: 2px solid #808080;
    margin-bottom: 12px;
}

.window-body {
    padding: 9px;
    background: rgba(192, 192, 192, 0.95);
    border: none;
    margin: 0;
}

.title-bar {
    background: linear-gradient(90deg, #0040ff 0%, #4080ff 100%);
    color: white;
    padding: 2px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 21px;
}

.title-bar-text {
    padding: 0 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.title-bar-controls {
    display: flex;
    gap: 2.3px;
}

.title-bar-controls button {
    width: 18.4px;
    height: 16.1px;
    padding: 0;
    margin: 0;
    background: #c0c0c0;
    border: 2px solid #c0c0c0;
    border-top: 2px solid #dfdfdf;
    border-left: 2px solid #dfdfdf;
    border-right: 2px solid #808080;
    border-bottom: 2px solid #808080;
    font-size: 9.2px;
    line-height: 1;
}

.title-bar-controls button:active {
    border: 2px solid #c0c0c0;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #dfdfdf;
    border-bottom: 2px solid #dfdfdf;
}

/* Fieldset styling for Windows 98 groups */
fieldset {
    border: 2px groove #c0c0c0;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #dfdfdf;
    border-bottom: 2px solid #dfdfdf;
    margin: 11.5px 0;
    padding: 11.5px;
    background: rgba(192, 192, 192, 0.95);
}

fieldset legend {
    background: rgba(192, 192, 192, 0.95);
    padding: 0 4.6px;
    font-size: 12.65px;
    font-weight: bold;
    color: #000;
}

/* Input and button styling */
input, textarea, select {
    background: #fff;
    border: 2px inset #c0c0c0;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #dfdfdf;
    border-bottom: 2px solid #dfdfdf;
    padding: 2.3px 4.6px;
    font-family: 'MS Sans Serif', sans-serif;
    font-size: 12.65px;
    color: #000;
}

input:focus, textarea:focus, select:focus {
    outline: none;
}

button {
    background: #c0c0c0;
    border: 2px solid #c0c0c0;
    border-top: 2px solid #dfdfdf;
    border-left: 2px solid #dfdfdf;
    border-right: 2px solid #808080;
    border-bottom: 2px solid #808080;
    padding: 4.6px 9.2px;
    font-family: 'MS Sans Serif', sans-serif;
    font-size: 12.65px;
    color: #000;
    cursor: pointer;
    margin: 2.3px;
}

button:hover {
    background: #c0c0c0;
}

button:active {
    border: 2px solid #c0c0c0;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #dfdfdf;
    border-bottom: 2px solid #dfdfdf;
}

button:disabled {
    color: #808080;
    cursor: default;
}

/* Labels */
label {
    font-size: 12px;
    color: #000;
    cursor: pointer;
}

/* Checkbox styling - Override 98.css */
input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    margin: 0 6px 0 0 !important;
    background: #fff !important;
    border: 2px inset #c0c0c0 !important;
    border-top: 2px solid #808080 !important;
    border-left: 2px solid #808080 !important;
    border-right: 2px solid #dfdfdf !important;
    border-bottom: 2px solid #dfdfdf !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    position: relative !important;
    cursor: pointer !important;
    display: inline-block !important;
    vertical-align: middle !important;
    flex-shrink: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    min-width: 16px !important;
    min-height: 16px !important;
}

input[type="checkbox"]:checked {
    background: #fff !important;
}

input[type="checkbox"]:checked::after {
    content: '✓' !important;
    position: absolute !important;
    left: 2px !important;
    top: -1px !important;
    font-size: 12px !important;
    color: #000 !important;
    font-weight: bold !important;
    line-height: 1 !important;
    display: block !important;
}

/* Ensure label with checkbox is properly displayed */
fieldset label {
    display: flex !important;
    align-items: center !important;
    font-size: 11px !important;
    color: #000 !important;
    cursor: pointer !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Download options row - horizontal layout */
.download-options-row {
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
    flex-wrap: wrap !important;
}

/* Paragraphs in window bodies */
.window-body p {
    font-size: 12.65px;
    color: #000;
    margin: 5.75px 0;
    line-height: 1.2;
}

/* Utility classes */
.hidden {
    display: none !important;
}

/* Input groups */
.input-group {
    display: flex;
    gap: 5.75px;
    margin-bottom: 11.5px;
    align-items: center;
}

.input-group input {
    flex: 1;
}

/* Actions */
.actions {
    display: flex;
    gap: 5.75px;
    margin-top: 11.5px;
    flex-wrap: wrap;
}

.url-actions {
    display: flex;
    gap: 5.75px;
    margin-top: 11.5px;
    flex-wrap: wrap;
}

/* Status messages */
.error-message {
    color: #800000;
    font-weight: bold;
    margin-top: 6px;
    font-size: 12px;
}

.status-message {
    color: #008000;
    font-weight: bold;
    margin-top: 6px;
    font-size: 12px;
}

/* Progress bars */
.progress-bar {
    width: 100%;
    height: 23px;
    background: #c0c0c0;
    border: 2px inset #c0c0c0;
    margin-bottom: 5.75px;
}

.progress-fill {
    height: 100%;
    background: #0000ff;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    font-size: 12.65px;
    color: #000;
    margin-top: 2.3px;
}

/* Track list */
#tracks-list {
    max-height: 345px;
    overflow-y: auto;
    background: #fff;
    border: 2px inset #c0c0c0;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #dfdfdf;
    border-bottom: 2px solid #dfdfdf;
    padding: 5.75px;
    margin-bottom: 11.5px;
}

/* YouTube URLs textarea */
#youtube-urls {
    width: 100%;
    min-height: 115px;
    font-family: 'Courier New', monospace;
    font-size: 12.65px;
    background: #fff;
    border: 2px inset #c0c0c0;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #dfdfdf;
    border-bottom: 2px solid #dfdfdf;
    padding: 4.6px;
    resize: vertical;
}

#youtube-urls:focus {
    outline: none;
}

/* Search progress - Always hidden */
.search-progress {
    display: none !important;
    background: #fff;
    border: 2px inset #c0c0c0;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #dfdfdf;
    border-bottom: 2px solid #dfdfdf;
    padding: 5.75px;
    margin-bottom: 11.5px;
    font-family: 'Courier New', monospace;
    font-size: 12.65px;
    height: calc(7 * 1.4 * 12.65px + 11.5px); /* 7 lines * line-height * font-size + padding */
    overflow-y: auto;
    white-space: pre-wrap;
}

/* Track items */
.track-item {
    display: flex;
    flex-direction: row;
    padding: 5.75px 0;
    border-bottom: 1px solid #c0c0c0;
    gap: 8px;
    align-items: center;
}

.track-item:last-child {
    border-bottom: none;
}

/* Track artwork section */
.track-artwork {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: none;
}

.track-image {
    width: 46px;
    height: 46px;
    object-fit: cover;
    display: block;
}

.track-image.youtube-thumbnail {
    /* For YouTube thumbnails, crop to square */
    object-fit: cover;
    object-position: center;
}

.track-image.spotify-artwork {
    /* Spotify artwork is already square, so use contain to preserve aspect ratio */
    object-fit: contain;
}

.track-image-placeholder {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    color: #808080;
    font-size: 20px;
    border: 1px solid #c0c0c0;
}

.track-image-placeholder.youtube-thumbnail {
    background: #ff0000;
    color: #fff;
}

.track-image-placeholder.spotify-artwork {
    background: #1db954;
    color: #fff;
}

.track-info {
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.track-title {
    font-weight: bold;
    color: #000;
    font-size: 12.65px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2.3px;
}

.track-artist {
    color: #000;
    font-size: 12.65px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3.45px;
}

.track-actions {
    display: flex;
    align-items: center;
    gap: 5.75px;
    flex-wrap: wrap;
}

/* Track status indicators */
.track-status {
    padding: 2.3px 6.9px;
    font-size: 12.65px;
    font-weight: bold;
    min-width: 92px;
    text-align: center;
    background: #c0c0c0;
    border: 2px solid #c0c0c0;
    border-top: 2px solid #dfdfdf;
    border-left: 2px solid #dfdfdf;
    border-right: 2px solid #808080;
    border-bottom: 2px solid #808080;
    color: #000;
}

.track-status.pending {
    background: #808080;
    color: #fff;
}

.track-status.searching {
    background: #ffff00;
    color: #000;
}

.track-status.found {
    background: #0000ff;
    color: #fff;
}

.track-status.downloading {
    background: #ff8000;
    color: #000;
}

.track-status.completed {
    background: #008000;
    color: #fff;
}

.track-status.error {
    background: #ff0000;
    color: #fff;
}

.track-status.not-found {
    background: #800000;
    color: #fff;
}

.track-status.downloaded {
    background: #008080;
    color: #fff;
}

.track-status.saved {
    background: #800080;
    color: #fff;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 20px;
    padding: 10px;
    color: #fff;
    font-size: 11px;
    background: #000;
    display: inline-block;
    border: 1px solid #808080;
}

/* Additional Windows 98 styling */
.window-body h2, .window-body h3 {
    font-size: 12.65px;
    font-weight: bold;
    color: #000;
    margin: 5.75px 0;
}

/* Status display areas */
#tracks-info {
    background: #c0c0c0;
    padding: 5.75px;
    margin-bottom: 11.5px;
    font-size: 12.65px;
    color: #000;
    border: 1px inset #c0c0c0;
}

/* Download progress section */
#download-progress {
    background: #c0c0c0;
    padding: 5.75px;
    margin-bottom: 11.5px;
}

#download-results {
    background: #fff;
    border: 2px inset #c0c0c0;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #dfdfdf;
    border-bottom: 2px solid #dfdfdf;
    padding: 5.75px;
    margin-bottom: 11.5px;
    max-height: 230px;
    overflow-y: auto;
    font-size: 12.65px;
}

/* Results summary */
#results-summary {
    background: #fff;
    border: 2px inset #c0c0c0;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #dfdfdf;
    border-bottom: 2px solid #dfdfdf;
    padding: 9.2px;
    margin-bottom: 11.5px;
    font-size: 12.65px;
    color: #000;
}

/* Menu separator lines */
.separator {
    border-top: 1px solid #808080;
    border-bottom: 1px solid #fff;
    height: 0;
    margin: 5px 0;
}

/* Text input specific styling */
#url-input {
    width: 100%;
    box-sizing: border-box;
    border: 2px inset #c0c0c0;
    border-top: 2px solid #808080;
    border-left: 2px solid #808080;
    border-right: 2px solid #dfdfdf;
    border-bottom: 2px solid #dfdfdf;
}

/* Ensure proper text rendering */
.window-body * {
    font-family: 'MS Sans Serif', sans-serif;
    font-size: 11px;
}

/* Monospace override for specific elements */
#youtube-urls, .search-progress, pre, code {
    font-family: 'Courier New', monospace !important;
}

/* Group boxes similar to Windows 98 */
.group-box {
    border: 2px groove #c0c0c0;
    padding: 10px;
    margin: 10px 0;
    background: #c0c0c0;
}

.group-box legend {
    background: #c0c0c0;
    padding: 0 4px;
    font-weight: bold;
    color: #000;
}

/* Responsive design */
@media (min-width: 1200px) {
    .two-column-layout {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        align-items: start;
    }
    
    /* Make both windows have similar heights by setting equal content heights */
    #youtube-urls {
        height: 345px;
        min-height: 115px;
        /* Remove max-height to allow resizing */
    }
    
    #tracks-list {
        height: 345px;
        min-height: 345px;
        max-height: 345px;
    }
    
    /* Ensure both windows have the same overall height */
    #youtube-urls-section .window-body,
    #tracks-section .window-body {
        height: auto;
        min-height: 450px;
    }
}

@media (max-width: 768px) {
    #app {
        padding: 5px;
    }
    
    header h1 {
        font-size: 16px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .actions, .url-actions {
        flex-direction: column;
    }
    
    .track-actions {
        flex-direction: column;
        align-items: flex-start;
    }
    
    /* Make URL input window full width on small screens */
    #url-input-section {
        width: 100%;
    }
}

/* Loading spinner - Windows 98 style */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #808080;
    border-top: 2px solid #000;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Remove any leftover modern styling */
* {
    border-radius: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

/* Pixel-perfect rendering for all images - true nearest neighbor */
img, .zoom-icon, .header-gif, img[src$=".gif"], img[src*=".gif"], img[src$=".png"], img[src*=".png"] {
    image-rendering: -moz-crisp-edges !important;
    image-rendering: -webkit-crisp-edges !important;
    image-rendering: pixelated !important;
    image-rendering: crisp-edges !important;
    image-rendering: -webkit-optimize-contrast !important;
    -ms-interpolation-mode: nearest-neighbor !important;
    -webkit-transform: translateZ(0) !important;
    transform: translateZ(0) !important;
    -webkit-backface-visibility: hidden !important;
    backface-visibility: hidden !important;
    -webkit-perspective: 1000 !important;
    perspective: 1000 !important;
    image-orientation: from-image !important;
    -webkit-font-smoothing: none !important;
    -moz-osx-font-smoothing: unset !important;
    font-smooth: never !important;
    text-rendering: optimizeSpeed !important;
}

/* Force nearest neighbor on background images too */
body::after, .header-gif, .zoom-icon {
    image-rendering: -moz-crisp-edges !important;
    image-rendering: -webkit-crisp-edges !important;
    image-rendering: pixelated !important;
    image-rendering: crisp-edges !important;
    image-rendering: -webkit-optimize-contrast !important;
    -ms-interpolation-mode: nearest-neighbor !important;
}

/* Ensure all text uses Windows 98 fonts - clean approach */
body, input, textarea, button, select, .title-bar, .window, label, legend, li[role=tab], option, table, ul.tree-view {
    font-family: 'MS Sans Serif', sans-serif !important;
    font-size: 11px !important;
    -webkit-font-smoothing: none !important;
    -moz-osx-font-smoothing: unset !important;
    font-smooth: never !important;
    text-rendering: optimizeSpeed !important;
}

/* Ensure monospace elements use Courier New */
#youtube-urls, .search-progress, pre, code {
    font-family: 'Courier New', monospace !important;
    -webkit-font-smoothing: none !important;
    -moz-osx-font-smoothing: unset !important;
    font-smooth: never !important;
    text-rendering: optimizeSpeed !important;
}
