body {
    font-family: "Times New Roman", Times, serif;
    background-color: #c0c0c0; /* Classic 90s gray */
    color: #000;
    margin: 0;
    overflow: hidden;
}

#container {
    display: flex;
    height: 100vh;
}

#sidebar {
    width: 350px;
    background-color: #c0c0c0;
    padding: 10px;
    border-right: 2px solid #fff;
    box-shadow: 2px 0 0 #808080;
    display: flex;
    flex-direction: column;
    position: relative; /* For positioning the button */
    transition: all 0.3s ease;
    box-sizing: border-box; /* Ensures padding and border are included in the width */
    flex-shrink: 0; /* Prevent the sidebar from shrinking */
}

#sidebar.collapsed {
    width: 30px; /* Make it smaller */
    padding: 10px 0;
    border-right-width: 0;
}

#sidebar.collapsed > *:not(#toggle-sidebar-btn) {
    display: none;
}


#toggle-sidebar-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 1px solid #808080;
    background-color: #c0c0c0;
    cursor: pointer;
    font-weight: bold;
    line-height: 1;
    z-index: 10;
}

#sidebar.collapsed #toggle-sidebar-btn {
    left: 50%;
    transform: translateX(-50%);
    right: auto;
}

#drop-zone {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 128, 0.7);
    border: 3px dashed #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    pointer-events: none;
    color: #fff;
    font-size: 1.5rem;
    font-weight: bold;
}

#drop-zone.hidden {
    display: none;
}


h1 {
    font-size: 1.5rem;
    color: #000080; /* Navy Blue */
    margin-top: 0;
    margin-bottom: 10px;
    font-weight: bold;
}

p {
    font-size: 1rem;
    margin-bottom: 15px;
}

#file-input-container {
    margin-bottom: 15px;
}

#clear-button {
    width: 100%;
    margin-top: 10px;
    padding: 5px;
    border: 2px outset #808080;
    background-color: #c0c0c0;
    font-weight: bold;
    cursor: pointer;
}

#clear-button:active {
    border-style: inset;
}

#draw-profile-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 40px;
    height: 40px;
    padding: 5px;
    border: 2px outset #808080;
    background-color: #c0c0c0;
    cursor: pointer;
    z-index: 50; /* Ensure it's above the canvas */
    display: flex;
    align-items: center;
    justify-content: center;
}

#draw-profile-btn svg {
    width: 24px;
    height: 24px;
    color: #000080;
}

#draw-profile-btn:active {
    border-style: inset;
}

#draw-profile-btn.active {
    border-style: inset;
    background-color: #a0a0a0;
    color: #fff;
}

#file-input {
    width: 100%;
    padding: 5px;
    border: 2px inset #808080;
    background-color: #fff;
}

#info-box {
    flex-grow: 1;
    background-color: #fff;
    border: 2px inset #808080;
    padding: 10px;
    font-size: 0.9rem;
    overflow-y: scroll;
    margin-bottom: 15px;
}

#file-tree {
    flex-grow: 1;
    background-color: #fff;
    border: 2px inset #808080;
    padding: 10px;
    overflow-y: auto;
    margin-bottom: 15px;
}

#file-tree .file-item {
    padding: 2px 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

#file-tree .file-item:hover {
    background-color: #000080;
    color: #fff;
}

#file-tree .file-item input {
    margin-right: 8px;
}

/* New 90s style "Info" panel */
#info-container {
    border: 2px groove #808080;
    margin: 0;
    padding: 10px;
    margin-top: 15px;
    flex-shrink: 0; /* Prevent shrinking */
}

#info-legend {
    padding: 0 5px;
    cursor: pointer;
    font-weight: bold;
    color: #000080;
}

#info-legend:hover {
    background-color: #000080;
    color: #fff;
}

#info-content {
    max-height: 200px; /* Start expanded */
    overflow-y: auto;
    transition: max-height 0.2s ease-out, padding 0.2s ease-out;
    padding: 10px;
}

#info-content.hidden {
    max-height: 0;
    padding: 0 10px;
}


/* New 90s style "Settings" panel */
#settings-container {
    border: 2px groove #808080;
    margin: 0;
    padding: 10px;
    margin-top: 15px; /* Add some space above */
}

#settings-legend {
    padding: 0 5px;
    cursor: pointer;
    font-weight: bold;
    color: #000080;
}

#settings-legend:hover {
    background-color: #000080;
    color: #fff;
}

#settings-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out, padding 0.2s ease-out;
    padding: 0 10px;
}

#settings-content.visible {
    max-height: 200px; /* Adjust as needed */
    padding: 10px;
}

#settings-content label {
    margin-right: 10px;
}

/* New 90s style "About" panel */
#about-container {
    border: 2px groove #808080;
    margin: 0;
    padding: 10px;
    margin-top: auto;
}

#about-legend {
    padding: 0 5px;
    cursor: pointer;
    font-weight: bold;
    color: #000080;
}

#about-legend:hover {
    background-color: #000080;
    color: #fff;
}

#about-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out, padding 0.2s ease-out;
    padding: 0 10px;
}

#about-content.visible {
    max-height: 200px;
    padding: 10px;
}

#about-content h4 {
    margin-top: 0;
}

#viewer-container {
    flex-grow: 1;
    position: relative;
    border: 2px inset #808080;
    background-color: #000;
}

#thumbnail-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 5px;
    display: flex;
    gap: 5px;
    overflow-x: auto;
    height: 60px; /* Give it a fixed height */
    box-sizing: border-box;
    align-items: center; /* Vertically center thumbnails */
}

.thumbnail-item {
    padding: 10px;
    background-color: #e0e0e0;
    border: 2px outset #808080;
    color: #000;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
}

.thumbnail-item.disabled {
    background-color: #a0a0a0;
    color: #505050;
    border-style: inset;
}

#profile-modal {
    position: absolute;
    bottom: 60px; /* Position it above the thumbnail bar */
    left: 0;
    width: 100%;
    height: 33vh; /* 1/3 of the viewport height */
    background-color: rgba(192, 192, 192, 0.9);
    border-top: 2px outset #808080;
    z-index: 100;
    padding: 10px;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    transform: translateY(calc(100% + 60px)); /* Start hidden */
    transition: transform 0.3s ease-in-out;
    box-sizing: border-box;
}

#profile-modal:not(.hidden) {
    transform: translateY(0);
}

#profile-modal.hidden {
    pointer-events: none; /* Prevent interaction when hidden */
}

#profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #808080;
    margin-bottom: 10px;
}

#profile-header h3 {
    margin: 0;
    color: #000080;
}

#close-profile-btn {
    background: none;
    border: 1px solid #808080;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0 5px;
}


canvas {
    display: block;
}

.spinner {
    border: 5px solid #c0c0c0;
    border-top: 5px solid #000080;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -25px;
    margin-left: -25px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Welcome Popup Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

.popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    border: 3px outset #808080;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: popupSlideIn 0.4s ease-out;
}

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

.popup-header {
    background: linear-gradient(135deg, #000080 0%, #0000a0 100%);
    color: white;
    padding: 20px;
    border-radius: 7px 7px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
}

.popup-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.popup-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.popup-body {
    padding: 30px;
    text-align: center;
}

.welcome-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
}

.popup-body h3 {
    color: #000080;
    margin: 0 0 15px 0;
    font-size: 1.3rem;
}

.popup-body p {
    color: #333;
    margin: 0 0 25px 0;
    line-height: 1.5;
}

.feature-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 25px 0;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background-color: rgba(0, 0, 128, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 128, 0.2);
}

.feature-icon {
    font-size: 1.5rem;
    min-width: 30px;
}

.feature-item span:last-child {
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
}

.popup-actions {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.btn-primary {
    background: linear-gradient(135deg, #000080 0%, #0000a0 100%);
    color: white;
    border: 2px outset #404080;
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    min-width: 150px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0000a0 0%, #000080 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 128, 0.3);
}

.btn-primary:active {
    border-style: inset;
    transform: translateY(0);
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
}

.checkbox-container input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #808080;
    border-radius: 3px;
    display: inline-block;
    position: relative;
    background-color: white;
}

.checkbox-container input[type="checkbox"]:checked + .checkmark {
    background-color: #000080;
    border-color: #000080;
}

.checkbox-container input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Responsive design for popup */
@media (max-width: 600px) {
    .popup-content {
        width: 95%;
        margin: 10px;
    }
    
    .feature-list {
        grid-template-columns: 1fr;
    }
    
    .popup-header h2 {
        font-size: 1.3rem;
    }
    
    .popup-body {
        padding: 20px;
    }
} 