/* VibeCoding Layout System - Consolidated from app-layout.css and layout-fix.css */

/* Global body styling */
body {
    background-color: #000;
    color: #fff;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

/* Main app container with grid layout system */
.app-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
        "control control"
        "audio uploader";
    gap: 20px;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 20px;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
    box-sizing: border-box;
    background: transparent;
    pointer-events: none;
}

/* Grid area assignments */
.control-panel {
    grid-area: control;
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    pointer-events: auto;
}

.audio-visualizer {
    grid-area: audio;
    background-color: #1e1e1e;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
}

.uploader-tabs-container {
    grid-area: uploader;
    pointer-events: auto;
}
/* Dual Canvas Layer System */
.canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Background Canvas - Layer 1 (behind everything) */
#backgroundCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* Firework Canvas - Layer 2 (on top of background, behind UI) */
#animationCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

/* Control panel button styling */
.control-panel button {
    background-color: #2c2c2c;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.control-panel button:hover {
    background-color: #3a3a3a;
}

.mic-button {
    background-color: #4CAF50 !important;
}

/* Audio visualizer components */
.volume-meter {
    height: 10px;
    background-color: #333;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.level-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #4CAF50, #2196F3);
    transition: width 0.1s linear;
}

/* Upload button styling */
#selectFiles, #selectBgFiles {
    padding: 12px 20px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 20 !important;
    position: relative !important;
    pointer-events: auto !important;
}
#selectFiles:hover, #selectBgFiles:hover {
    background-color: #45a049;
}

/* Tab button enhancements */
.uploader-tab-button {
    font-weight: 600;
    position: relative;
    z-index: 5;
    pointer-events: auto;
}

.uploader-tab-button.active {
    background-color: rgba(255, 255, 255, 0.08);
    color: white;
}

/* Tab pane height management */
.uploader-tab-pane {
    max-height: 75vh;
    overflow-y: auto;
    position: relative;
    z-index: 5;
}

/* Upload container styling */
.background-upload-container,
.image-upload-container {
    padding: 15px;
    position: relative;
    z-index: 5;
}

/* General button enhancements */
.button, button {
    position: relative;
    z-index: 10;
    cursor: pointer !important;
}

/* === RESPONSIVE DESIGN === */

/* Tablet layout (1024px and below) */
@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 1fr;
        grid-template-areas:
            "control"
            "uploader"
            "audio";
        gap: 16px;
        padding: 16px;
    }
}
/* Mobile layout (768px and below) */
@media (max-width: 768px) {
    .app-container {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: none !important;
        grid-template-areas: none !important;
        gap: 12px;
        padding: 12px;
        height: calc(100vh - 24px);
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .control-panel {
        flex: 0 0 auto;
        grid-area: none;
    }
    
    .uploader-tabs-container {
        flex: 1 1 auto;
        grid-area: none;
        min-height: 0;
        overflow: hidden;
    }
    
    .audio-visualizer {
        flex: 0 0 auto;
        grid-area: none;
        min-height: 120px;
        max-height: 150px;
    }
    
    .uploader-tab-pane {
        height: 100% !important;
        max-height: none !important;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .background-upload-container,
    .image-upload-container {
        padding: 12px;
        height: 100%;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    
    .button, button {
        min-height: 44px;
        border-radius: 8px;
    }    
    #selectFiles,
    #selectBgFiles {
        padding: 12px 20px;
        font-size: 14px;
    }
}

/* Small mobile layout (480px and below) */
@media (max-width: 480px) {
    .app-container {
        gap: 10px;
        padding: 8px;
        height: calc(100vh - 16px);
    }
    
    .audio-visualizer {
        min-height: 100px;
        max-height: 120px;
    }
    
    .background-upload-container,
    .image-upload-container {
        padding: 10px;
    }
    
    .uploader-tab-pane {
        height: 100% !important;
        max-height: none !important;
    }
}

/* Very small screens (360px and below) */
@media (max-width: 360px) {
    .app-container {
        padding: 5px;
        gap: 8px;
        height: calc(100vh - 10px);
    }
    
    .background-upload-container,
    .image-upload-container {
        padding: 8px;
    }
    
    .audio-visualizer {
        min-height: 80px;
        max-height: 100px;
    }
}