/* Enhance the app container layout for better positioning of tabs */
.app-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
        "control control"
        "audio uploader";
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 10;
}

.control-panel {
    grid-area: control;
}

.audio-visualizer {
    grid-area: audio;
}

.uploader-tabs-container {
    grid-area: uploader;
}

/* Make canvas full screen and position behind UI elements */
#animationCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0 !important; /* Behind UI elements but in front of body background */
    pointer-events: none !important; /* Prevents the canvas from capturing clicks */
}

/* Responsive layout adjustments */
@media (max-width: 992px) {
    .app-container {
        grid-template-columns: 1fr;
        grid-template-areas:
            "control"
            "uploader"
            "audio";
    }
}

/* Ensure text in tabs is readable */
.uploader-tab-button {
    font-weight: 600;
    position: relative; /* ADDED */
    z-index: 5; /* ADDED */
    pointer-events: auto; /* ADDED to re-enable clicks */
}

/* Add max-height to uploaders to prevent extremely tall content */
.uploader-tab-pane {
    max-height: 75vh;
    overflow-y: auto;
    position: relative; /* ADDED */
    z-index: 5; /* ADDED */
}

/* Make sure the upload containers fit within tabs */
.background-upload-container,
.image-upload-container {
    padding: 15px;
    position: relative; /* ADDED */
    z-index: 5; /* ADDED */
}

/* Enhance tab active state for better visibility */
.uploader-tab-button.active {
    background-color: rgba(255, 255, 255, 0.08);
    color: white;
}

/* ADDED - Make buttons clickable */
.button, button {
    position: relative;
    z-index: 10;
    cursor: pointer !important;
}

/* ADDED - Specifically target the file select buttons */
#selectFiles,
#selectBgFiles {
    z-index: 20 !important;
    position: relative !important;
    pointer-events: auto !important;
}