.photo-preview-app-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    margin: 2em 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.photo-preview-header {
    padding: 1.5em;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
}

.photo-preview-header h3 {
    margin-top: 0;
    margin-bottom: 0.5em;
    font-size: 1.25em;
}

.photo-preview-header p {
    color: #666;
    margin-bottom: 1em;
    font-size: 0.9em;
}

.file-input-wrapper {
    display: flex;
    align-items: center;
    gap: 1em;
}

.file-input-button {
    display: inline-block;
    padding: 8px 16px;
    background: #0073aa;
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.file-input-button:hover {
    background: #005177;
}

#photo-preview-status {
    font-size: 0.9em;
    color: #444;
}

.photo-preview-layout {
    display: flex;
    min-height: 600px;
}

.photo-preview-sidebar {
    width: 250px;
    border-right: 1px solid #ddd;
    background: #fafafa;
    display: flex;
    flex-direction: column;
}

.photo-preview-sidebar h4 {
    margin: 0;
    padding: 1em;
    font-size: 1em;
    border-bottom: 1px solid #ddd;
    background: #eee;
}

.file-list {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    flex: 1;
    max-height: 600px;
}

.file-list li {
    padding: 10px 15px;
    border-bottom: 1px solid #eaeaea;
    cursor: pointer;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 0.2s;
}

.file-list li:hover {
    background: #e6f7ff;
}

.file-list li.active {
    background: #0073aa;
    color: #fff;
}

.file-list li.empty-message {
    color: #999;
    text-align: center;
    padding: 2em 1em;
    cursor: default;
}

.file-list li.empty-message:hover {
    background: none;
}

.photo-preview-main {
    flex: 1;
    background: #000;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.viewer-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    display: flex;
    gap: 8px;
}

.control-btn {
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s, color 0.2s;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #000;
}

.viewer-message {
    color: #fff;
    font-size: 1.1em;
}

.viewer-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.dicom-canvas {
    width: 100%;
    height: 100%;
}

.loading-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 10px 20px;
    border-radius: 4px;
    z-index: 100;
}

/* JS9 overrides */
#photo-preview-fits-container .JS9Menubar {
    background-color: #f1f1f1;
    border-bottom: 1px solid #ddd;
}

#photo-preview-fits-container .JS9 {
    width: 100%;
    height: calc(100% - 40px); /* Account for menubar height */
}
