.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-overlay.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content-wide {
    background: var(--bg-light);
    border-radius: 15px;
    width: 95%;
    max-width: 1000px;
    max-height: 100vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(93, 92, 222, 0.3);
}

body.dark .modal-content-wide {
    background: var(--bg-dark);
    border: 1px solid rgba(93, 92, 222, 0.5);
}

.modal-body-redesigned {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 80vh;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid rgba(93, 92, 222, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h5 {
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
}

.btn-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--primary-color);
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.btn-close:hover {
    background-color: rgba(93, 92, 222, 0.1);
}

/* Wave Graph Section */
.wave-graph-section {
    flex: 0 0 auto;
    text-align: center;
}

.graph-title {
    margin-bottom: 10px;
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 600;
}

#waveformCanvas {
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    width: 100%;
    max-width: 600px;
    height: 200px;
}

body.dark #waveformCanvas {
    background: rgba(0, 0, 0, 0.2);
}

/* Sliders Section */
.sliders-section {
    flex: 1;
    min-height: 0;
}

.sliders-container {
    display: flex;
    height: 100%;
    gap: 15px;
    align-items: center;
}

.sliders-scroll {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    gap: 15px;
    padding: 10px 0;
    min-height: 240px;
}

.sliders-scroll::-webkit-scrollbar {
    height: 8px;
}

.sliders-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.sliders-scroll::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

/* Individual Slider */
.vertical-slider-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    flex-shrink: 0;
    background: rgba(93, 92, 222, 0.05);
    border: 1px solid rgba(93, 92, 222, 0.2);
    border-radius: 12px;
    padding: 10px;
}

.slider-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
}

.harmonic-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.slider-buttons {
    display: flex;
    gap: 5px;
}

.reset-btn-circle, .delete-btn-circle {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid;
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.reset-btn-circle {
    border-color: #ffc107;
    color: #ffc107;
}

.reset-btn-circle:hover {
    background-color: #ffc107;
    color: #000;
}

.delete-btn-circle {
    border-color: #dc3545;
    color: #dc3545;
}

.delete-btn-circle:hover {
    background-color: #dc3545;
    color: white;
}

body.dark .reset-btn-circle {
    border-color: #ffeb3b;
    color: #ffeb3b;
}

body.dark .delete-btn-circle {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

body.dark .delete-btn-circle:hover {
    background-color: #ff6b6b;
    color: #000;
}

/* Vertical Sliders */
.vertical-sliders {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
    align-items: center;
}

.vertical-slider-pair {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.vertical-slider-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 110px;
}

.vertical-slider {
    writing-mode: bt-lr; /* IE */
    -webkit-appearance: slider-vertical; /* WebKit */
    width: 25px;
    height: 90px;
    background: rgba(93, 92, 222, 0.2);
    outline: none;
    cursor: pointer;
}

.slider-label {
    font-size: 10px;
    color: var(--primary-color);
    margin-bottom: 5px;
    text-align: center;
}

.slider-values {
    display: flex;
    flex-direction: row;
    gap: 5px;
    margin-top: 10px;
    align-items: center;
}

.value-display-small {
    font-size: 10px;
    text-align: center;
    background: rgba(93, 92, 222, 0.1);
    border: 1px solid rgba(93, 92, 222, 0.3);
    border-radius: 4px;
    padding: 2px 4px;
    min-width: 35px;
}

/* Add Harmonic Button */
.add-harmonic-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: none;
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.add-harmonic-circle:hover {
    background-color: rgba(93, 92, 222, 0.8);
    transform: scale(1.05);
}

.add-harmonic-circle:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

body.dark .add-harmonic-circle:disabled {
    background-color: #555;
}

/* Controls Section */
.controls-section {
    flex: 0 0 auto;
    display: flex;
    gap: 15px;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid rgba(93, 92, 222, 0.2);
}

.waveform-name-input {
    flex: 1;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    padding: 10px;
    font-size: 14px;
}

body.dark .waveform-name-input {
    background-color: #2a2a2a;
    color: #e0e0e0;
    border-color: var(--primary-color);
}

.control-buttons {
    display: flex;
    gap: 10px;
}

.control-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary.control-btn {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary.control-btn:hover {
    background-color: rgba(93, 92, 222, 0.8);
}

.btn-success.control-btn {
    background-color: #28a745;
    color: white;
}

.btn-success.control-btn:hover {
    background-color: #218838;
}

/* Delete confirm modal */
#deleteConfirmModal .modal-content {
	background: white;
	padding: 2%;
	border-radius: 10px;
	max-width: 500px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .modal-content-wide {
        width: 98%;
        max-height: 95vh;
    }
    
    .modal-body-redesigned {
        gap: 15px;
    }
    
    .vertical-slider-group {
        min-width: 70px;
    }
    
    .controls-section {
        flex-direction: column;
        gap: 10px;
    }
    
    .control-buttons {
        width: 100%;
        justify-content: center;
    }
}