/* Basic body styling to center the window and set a Win98 background */
body {
    background-color: #008080;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    overflow: hidden;
    font-family: 'MS Sans Serif', 'Arial', sans-serif;
}

/* Common hidden class */
.hidden {
    display: none !important;
}

/* Main application window styling */
.window {
    width: 90vw;
    max-width: 800px;
    height: auto;
    margin: auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
}

/* Toolbar Styling */
.toolbar {
    display: flex;
    justify-content: space-around;
    padding: 2px;
    background-color: #c0c0c0;
    border-bottom: 1px solid #000;
    border-top: 1px solid #fff;
}

.toolbar button {
    flex-grow: 1;
    margin: 0 2px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 70px;
    height: 70px;
    padding: 4px;
    line-height: 1.2;
    font-size: 0.8em;
    text-align: center;
    white-space: normal;
}

.toolbar button img {
    width: 32px;
    height: 32px;
    margin-bottom: 4px;
    image-rendering: pixelated;
}

.toolbar button.active {
    border-top: 1px solid #000;
    border-left: 1px solid #000;
    border-bottom: 1px solid #fff;
    border-right: 1px solid #fff;
    position: relative;
    top: 1px;
    left: 1px;
}

/* Debug Toggle Button within Title Bar */
.title-bar-controls #debug-toggle {
    margin-left: 4px;
    font-size: 0.7em;
    width: 20px;
    height: 18px;
    line-height: 1;
    box-sizing: border-box;
}

.title-bar-controls #debug-toggle.active {
    border-top: 1px solid #000;
    border-left: 1px solid #000;
    border-bottom: 1px solid #fff;
    border-right: 1px solid #fff;
    position: relative;
    top: 1px;
    left: 1px;
}

/* Styling for the content area */
.window-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 6px;
    display: flex;
    flex-direction: column;
}

/* Loading Section Styling */
#loading-section {
    padding: 20px;
    margin: auto; /* Vertically and horizontally center in the flex container */
    text-align: center;
}

#loading-section .progress-indicator {
    width: 80%;
    margin: 10px auto;
}

#loading-section .progress-indicator-bar {
    transition: width 0.3s ease-in-out; /* Smooth transition for the bar */
}

.loading-text {
    font-style: italic;
    color: #555;
    margin-top: 8px;
    min-height: 1em; /* Prevent layout shift */
}

/* Jacket Hero Section */
#jacket-hero {
    text-align: center;
    padding-bottom: 10px;
}

#jacket-image-cell {
    width: 360px;
    height: 360px;
    margin: 10px auto;
    background-color: #fff;
    border: 1px solid #808080;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#jacket-image-cell img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

#recommended-jacket {
    margin: 8px 0;
}

#show-more-button {
    width: auto;
    padding: 2px 12px;
    margin: 4px auto;
}

/* Zip Code Input Section Styling */
#zip-code-input {
    padding: 10px;
    margin-top: 15px;
    border: 1px solid #c0c0c0;
    background-color: #e0e0e0;
    text-align: center;
}

#zip-code-input .field-row {
    justify-content: center;
    margin-top: 8px;
}

#zip-input {
    width: 100px;
    margin-right: 5px;
}

.error-message {
    color: red;
    font-size: 0.8em;
    margin-top: 5px;
    min-height: 1em;
}

/* Expanded content specific styles */
#expanded-content {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #c0c0c0;
    text-align: left;
}

#expanded-content h4 { margin-top: 0; margin-bottom: 8px; }
#expanded-content ul { list-style: square; padding-left: 20px; margin-bottom: 10px; }
#expanded-content hr { border: none; border-top: 1px dotted #c0c0c0; margin: 15px 0; }

/* Styles for the "About" Dialog */
#dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 100;
}

#about-dialog {
    width: 300px;
    height: auto;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 101;
    margin: 0;
}

#about-dialog .window-body {
    text-align: left;
}

#about-dialog .window-body p {
    margin-bottom: 12px;
}

.status-bar-logo {
    margin-left: auto; /* Pushes the logo to the far right */
    padding-right: 4px;
}

.status-bar-logo img {
    height: 16px; /* Fits nicely in the status bar */
    vertical-align: middle; /* Aligns with the text vertically */
    image-rendering: pixelated;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    body { display: block; }
    .window { width: 100vw; height: 100vh; margin: 0; border: none; border-radius: 0; }
    .title-bar { border-top-left-radius: 0; border-top-right-radius: 0; }
    .status-bar { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
    .title-bar-controls { display: flex; align-items: center; }
    .title-bar-controls button[aria-label="Minimize"],
    .title-bar-controls button[aria-label="Maximize"],
    .title-bar-controls button[aria-label="Close"] { display: none; }
    .title-bar-controls #debug-toggle { margin-left: auto; }
    
    .toolbar button { width: 60px; height: 60px; }
    .toolbar button img { width: 28px; height: 28px; }

    #jacket-image-cell {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
    }
    
    .window-body { height: calc(100vh - 22px - 70px - 20px - 2px); }

    #about-dialog {
        width: 90vw;
    }
}