* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    min-height: 100vh;
    padding: 0;
    margin: 0;
}

.container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100vw;
    margin: 0 auto;
    padding: 10px;
    gap: 10px;
    height: 100vh;
}

@media (min-width: 1024px) {
    .container {
        flex-direction: row;
        align-items: flex-start;
        height: 100vh;
        overflow: hidden;
    }
}

.wall-container {
    position: relative;
    width: 100%;
    height: auto;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    flex: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 70vh;
}

@media (min-width: 1024px) {
    .wall-container {
        max-height: 100vh;
        height: 100%;
    }
}

.wall-image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    height: auto;
    object-fit: contain;
}

.panels-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: auto;
    cursor: pointer;
}

.panel {
    position: absolute;
    background-image: url('acoustic_panel.webp');
    mix-blend-mode: multiply;
    transition: all 0.3s ease;
    overflow: hidden;
    box-sizing: border-box;
}

.draggable {
    cursor: ns-resize;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    /* Prevent default touch actions like scrolling */
}

.draggable:hover {
    box-shadow: inset 0 0 0 2px rgba(76, 175, 80, 0.5);
}

.draggable:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to bottom, rgba(76, 175, 80, 0.3), transparent);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.draggable:hover:before {
    opacity: 1;
}

.dragging {
    opacity: 0.9 !important;
    box-shadow: 0 0 0 2px #4CAF50, 0 0 10px rgba(0, 0, 0, 0.3) !important;
    z-index: 10;
}

.controls {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    flex: 1;
    max-height: 100vh;
    overflow-y: auto;
    width: 100%;
    max-width: 400px;
}

.control-group {
    margin-bottom: 10px;
    width: 100%;
}

.control-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.control-group input[type="range"] {
    width: 75%;
    vertical-align: middle;
}

.control-group span {
    display: inline-block;
    width: 20%;
    text-align: right;
    padding-right: 5px;
}

button {
    padding: 6px 12px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    width: auto;
    margin-right: 8px;
    margin-bottom: 8px;
}

button:hover {
    background-color: #45a049;
}

.advanced-controls,
.panel-height-controls {
    margin-top: 20px;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
    background-color: #f9f9f9;
    width: 100%;
}

.advanced-controls h3,
.panel-height-controls h3 {
    margin-bottom: 15px;
    color: #555;
}

.panel-section {
    margin-bottom: 15px;
    padding: 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #fff;
}

.panel-section h4 {
    margin-bottom: 10px;
    color: #333;
    font-size: 16px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

.panel-height-controls .control-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 10px;
}

.panel-height-controls .control-group label {
    width: 100%;
    font-size: 14px;
}

.panel-height-controls .control-group input[type="range"] {
    width: 70%;
}

.panel-height-controls .control-group span {
    width: 25%;
}

.info {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.info h3 {
    margin-bottom: 10px;
}

.info p {
    margin-bottom: 5px;
    font-size: 14px;
}

.marker {
    position: absolute;
    pointer-events: none;
    border: 1px dashed rgba(255, 0, 0, 0.5);
}

.marker-horizontal {
    width: 100%;
    height: 1px;
    background-color: rgba(0, 0, 255, 0.5);
}

/* Drag instructions tooltip */
.drag-instructions {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 100;
}

.wall-container:hover .drag-instructions {
    opacity: 1;
}

/* Toggle button for mobile controls */
.toggle-controls-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #4CAF50;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    cursor: pointer;
    font-size: 24px;
    display: none;
    /* Hidden by default on desktop */
}

.toggle-controls-btn:hover {
    background-color: #45a049;
}

/* Mobile styles */
@media (max-width: 1023px) {
    .container {
        padding: 5px;
        height: auto;
    }

    .wall-container {
        margin-bottom: 10px;
        max-height: 80vh;
    }

    .controls {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        max-width: 85%;
        max-height: 100%;
        z-index: 900;
        transform: translateX(100%);
        transition: transform 0.3s ease;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
        padding: 10px;
    }

    .controls.visible {
        transform: translateX(0);
    }

    .toggle-controls-btn {
        display: flex;
        /* Show on mobile */
    }

    /* Hide drag instructions on mobile */
    .drag-instructions {
        display: none;
    }
}

/* Make buttons smaller on mobile */
@media (max-width: 767px) {
    button {
        padding: 6px 12px;
        font-size: 14px;
    }

    .control-group label {
        font-size: 14px;
    }
}

/* Add a subtle indicator when hovering over the panels container */
.panels-container:hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(76, 175, 80, 0.1), transparent);
    pointer-events: none;
    opacity: 0.5;
    z-index: 5;
}
