/* style-98.css - Custom styles for 98.css layout */

body {
    background-color: #008080; /* Classic Teal background */
    font-size: 12px; /* Base font size common in Win98 themes */
    padding-top: 50px; /* Space for fixed header */
}

/* --- Header --- */
.app-header {
    background-color: silver; /* Standard window grey */
    padding: 4px 10px;
    border-bottom: 1px solid white; /* 3D effect */
    box-shadow: 0 1px 0 black;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    position: fixed; /* Fixed header */
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    min-height: 42px; /* Ensure consistent height */
}

.header-logo img {
    height: 24px; /* Adjust logo size for 98 style */
    max-height: 24px;
    display: block;
    margin-right: 5px;
}

.header-form {
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 250px;
}

.header-form input[type="url"] {
    flex-grow: 1;
    height: 26px; /* Typical input height */
    padding: 2px 4px;
    /* 98.css handles the main input styling */
}

.header-form button[type="submit"] {
    min-width: 75px; /* Standard button width */
    height: 26px;
    padding: 0 12px;
    /* 98.css handles the button styling */
}

#loading-indicator {
    margin-left: 10px;
    font-style: italic;
    color: #333; /* Dark grey text */
}

/* --- Main Content Layout --- */
.container {
    max-width: 1200px; /* Adjust max-width if needed */
    margin: 0 auto;
    padding: 15px;
}

.main-content-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px; /* Space between columns */
}

.column-left,
.column-right {
    flex: 1 1 48%; /* Two equal columns on desktop */
    min-width: 300px; /* Prevent columns getting too small */
    display: flex;
    flex-direction: column;
    gap: 15px; /* Space between windows in a column */
}

/* --- Window Styling Overrides/Additions --- */
.window {
    margin-bottom: 0; /* Remove default margin as gap handles it */
    min-height: 150px; /* Give windows a minimum height */
    display: flex;
    flex-direction: column; /* Ensure body fills height */
}
.window .title-bar {
    /* Standard 98.css styling */
}
.window .window-body {
    padding: 10px;
    overflow-y: auto; /* Allow scrolling if content overflows */
    flex-grow: 1; /* Allow body to expand */
}

.window .window-body h4 { margin-top: 0px; margin-bottom: 8px; }

/* --- Image Preview Styling --- */
.image-preview-container {
    margin-bottom: 10px;
    border: 1px inset grey; /* Use inset border like sunken-panel */
    padding: 5px;
    background-color: silver; /* Match window background */
    min-height: 100px; /* Min height for placeholder */
    display: flex; /* Center placeholder text */
    justify-content: center;
    align-items: center;
}
.image-preview-container.has-image {
    background-color: white; /* White bg when image loads */
    padding: 2px; /* Reduce padding for loaded image */
}

.image-preview-container img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 400px; /* Limit height */
    object-fit: contain;
    margin: 0 auto 5px auto;
}

.image-preview-container .placeholder-text {
    color: #555;
    font-style: italic;
    text-align: center;
}


.image-preview-container a {
    display: block;
    text-align: center;
    font-size: 10px; /* Smaller font */
    color: navy;
    word-break: break-all;
    margin-top: 5px;
}

/* --- Icon Gallery Styling --- */
.icon-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 10px 0;
}

.icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 100px; /* Smaller icon containers */
}

.icon-image-wrapper {
    width: 64px; /* Adjust size */
    height: 64px;
    padding: 4px;
    border: 1px inset grey;
    background-color: white; /* White background for icons */
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 5px;
    overflow: hidden; /* Hide potential overflow */
}
.icon-image-wrapper.placeholder {
     background-color: silver; /* Grey bg for placeholder */
}


.icon-image-wrapper img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.icon-image-wrapper .placeholder-text {
     color: #555;
     font-size: 10px;
}


.icon-label {
    font-size: 10px;
    color: black;
    word-break: break-word;
}
.icon-label .rel {
    font-weight: bold;
}
.icon-label a {
    font-size: 9px;
    display: block;
    margin-top: 2px;
    word-break: break-all;
    color: navy;
}

/* --- Data Lists (dl, dt, dd) --- */
dl { margin: 5px 0; }
dt { font-weight: bold; color: black; margin-top: 6px; font-size: 11px;}
dd { margin-left: 15px; margin-bottom: 6px; color: #333; word-wrap: break-word; word-break: break-all; font-size: 11px;}
dd em { color: #555; font-style: normal; } /* Less emphasis on italics */
dd a { color: navy; }

/* --- Details/Summary for Raw Data --- */
/* Style <details> to look somewhat like a 98.css element */
details.raw-data-toggle {
    margin-top: 10px;
    border: 1px solid silver;
    border-radius: 0;
    background-color: #eee; /* Slightly off-white */
}
details.raw-data-toggle[open] {
    border: 1px solid black;
}

details.raw-data-toggle summary {
    padding: 4px 8px;
    font-size: 11px;
    font-weight: bold;
    color: black;
    background-color: silver; /* Match window title */
    border-bottom: 1px solid white;
    box-shadow: 0 1px 0 black;
    cursor: pointer;
    outline: none;
    list-style: none; /* Remove default marker */
    position: relative;
}
details.raw-data-toggle[open] summary {
     background-color: #ddd; /* Slightly darker when open */
}
details.raw-data-toggle summary::-webkit-details-marker,
details.raw-data-toggle summary::marker { display: none; }

details.raw-data-toggle summary::before { /* Use text marker */
    content: '[+]';
    display: inline-block;
    margin-right: 5px;
    font-weight: normal;
}
details.raw-data-toggle[open] summary::before {
    content: '[-]';
}

.raw-data-content {
    padding: 8px;
    font-size: 10px;
    background-color: white; /* White background for content */
    border-top: 1px solid grey;
    max-height: 300px; /* Limit height */
    overflow: auto; /* Allow scroll */
}
.raw-data-content dl { margin-left: 0; }
.raw-data-content dt { font-weight: bold; }
.raw-data-content dd { margin-left: 10px; }

/* --- Error Message Styling --- */
.error {
    /* Use standard window for errors */
    border: 1px solid black;
    padding: 0;
    margin: 0 0 15px 0; /* Error shown above grid */
    background-color: silver;
}
.error .title-bar {
    background: linear-gradient(90deg, navy, #1e90ff); /* Error title bar color */
    padding: 3px 2px 3px 3px;
}
.error .title-bar-text { color: white; }
.error .title-bar-controls button { background: silver; }
.error .window-body {
     padding: 10px;
     color: black;
     font-weight: bold;
}


/* --- Responsive Design --- */
@media (max-width: 768px) { /* Adjust breakpoint as needed */
    body { padding-top: 65px; } /* Adjust for potentially wrapped header */
    .app-header { padding: 5px; }
    .header-form { flex-basis: 100%; order: 3; } /* Force form to wrap */

    .main-content-grid {
        display: block; /* Stack columns */
    }
    .column-left,
    .column-right {
        flex-basis: 100%; /* Full width */
        margin-bottom: 15px; /* Space below stacked column */
        min-width: unset;
    }
     /* Ensure last column doesn't have extra bottom margin */
     .column-right { margin-bottom: 0; }
}
