.heading {
    margin-left: 2.5%;
    margin-right: 2.5%;
    font-size: 23px;
}

.audio_edt_tools {
    display: flex;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
}

.ae_tl {
    margin: 2px;
    padding: 6px 10px;
    border: 1px solid #000;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    background: #fff;
    user-select: none;
}

.ae_tl:hover {
    background: #000;
    color: #fff;
}

/* --- Sub Tool Panel Layout & Visibility --- */
.ae_sub_tool_panel {
    background: #f9f9f9;
    border: 1px solid #000;
    border-radius: 4px;
    margin: 10px 2.5%;
    padding: 15px;
    display: block;
}

.ae_sub_tool_panel:empty {
    display: none;
}

.ae_upld_bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 2.5%;
    flex-wrap: wrap;
    gap: 10px;
}

.ae_upld {
    max-width: 98px !important;
    display: flex;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    padding: 6px 12px;
    border: 1px dashed #000;
    border-radius: 4px;
    margin-bottom: 6px;
}

.ae_upld:hover {
    background: #000;
    color: #fff;
}

.ae_quick_actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ae_q_btn {
    padding: 6px 10px;
    border: 1px solid #000;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
}

.ae_q_btn:hover {
    background: #000;
    color: #fff;
}

.audio_editor {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    position: relative;
    overflow: hidden;
    max-height: 70vh;
    border: 1px solid #ccc;
    background: #e5e5e5;
    margin: 1.5% 2.5%;
    padding: 10px;
    min-height: 200px;
}

.audio_editor, .audio_editor * {
    box-sizing: border-box;
}

/* Scroll container only shows horizontal scrollbar when canvas exceeds visible width */
.waveform-scroll-container {
    width: 100%;
    overflow-x: hidden;
    overflow-y: hidden;
    position: relative;
    white-space: nowrap;
}

#ae_waveform_canvas {
    height: 200px;
    display: block;
    background: #fff;
    border: 1px solid #000;
}

/* Delete buttons are sticky pinned to the right edge of the visible editor viewport */
.track-delete-btn {
    position: absolute;
    right: 25px;
    padding: 3px 8px;
    font-size: 12px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    z-index: 20;
    transition: background 0.2s ease-in-out;
}

.track-delete-btn:hover {
    background: #bd2130;
}

/* Add track button top action bar styling */
.editor-controls-bar {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    z-index: 20;
}

.audio_edt_hr {
    margin: 1%;
    border-top: 1px solid #000;
}

.tool-controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.tool-control-group {
    display: flex;
    flex-direction: column;
    font-size: 13px;
}

.tool-control-group label {
    font-weight: bold;
    margin-bottom: 3px;
}

.tool-control-group input, .tool-control-group select, .tool-control-group button {
    padding: 4px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #fff;
}

.tool-action-btn {
    margin-top: 10px;
    padding: 6px 12px;
    border: 1px solid #000;
    background: #fff;
    cursor: pointer;
    font-weight: bold;
}

.tool-action-btn:hover {
    background: #000;
    color: #fff;
}

.ta-btn-apl {
    margin-top: 10px;
    padding: 6px 12px;
    border: 1px solid #28a745;
    background: #28a745;
    cursor: pointer;
    font-weight: bold;
}

.ta-btn-apl:hover {
    background: #000;
    border: 1px solid #000;
    color: #fff;
}

a {
    cursor: pointer;
}

a:link {
    text-decoration: none;
}

a:visited {
    color: #000;
}

a:hover {
    text-decoration: underline;
}

/* --- Effect Dropdown Styling --- */
.ae_dropdown {
    position: relative;
    display: inline-block;
}

.ae_dropdown_content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    min-width: 180px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1000;
    border: 1px solid #000;
    border-radius: 4px;
    max-height: 250px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.ae_dropdown_content.show {
    display: block;
}

.ae_dropdown_content a {
    color: #000;
    padding: 10px 14px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.ae_dropdown_content a:active,
.ae_dropdown_content a:hover {
    background-color: #000;
    color: #fff;
}

.ae_dropdown:hover .ae_dropdown_content {
    display: block;
}

/* --- Fully Responsive Modal Overlay & Content --- */
.ae_modal_overlay {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    padding: 12px;
    box-sizing: border-box;
}

.ae_modal_content {
    background-color: #fff;
    padding: 16px;
    border: 1px solid #000;
    border-radius: 6px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
}

.ae_modal_header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 16px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 8px;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.ae_modal_body {
    flex-grow: 1;
    overflow-y: auto;
    overflow-x: hidden;
    margin-bottom: 12px;
    padding-right: 4px;
    -webkit-overflow-scrolling: touch;
}

.ae_modal_footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    border-top: 1px solid #ccc;
    padding-top: 10px;
    flex-shrink: 0;
}

.ae_modal_footer .ae_q_btn,
.ae_modal_footer .tool-action-btn {
    margin: 0;
    padding: 8px 12px;
    font-size: 13px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Responsive Sliders & Controls Layout */
.ae_modal_body .ae_slider_group {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin-bottom: 4px;
}

.ae_modal_body .ae_slider_group label {
    width: 80px;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ae_modal_body .ae_slider_row {
    display: flex;
    flex-grow: 1;
    align-items: center;
    gap: 10px;
}

.ae_modal_body .ae_slider_row input[type="range"] {
    flex-grow: 1;
    width: 100%;
    height: 24px;
    cursor: pointer;
}

.ae_modal_body .ae_slider_val {
    min-width: 45px;
    text-align: right;
    font-weight: bold;
    font-size: 12px;
}

/* Fix Graphic EQ layout overlap */
.ae_modal_body .tool-controls-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

/* Responsive Canvas inside Paragraphic EQ */
#para_eq_canvas {
    max-width: 100%;
    height: auto;
}

/* Responsive Breakpoints */
@media screen and (max-width: 600px) {
    .ae_upld_bar {
        flex-direction: column;
        align-items: stretch;
    }
    .ae_quick_actions {
        justify-content: center;
    }
}

@media screen and (max-width: 480px) {
    .ae_modal_content {
        padding: 12px;
        max-height: 95vh;
    }
    
    .ae_modal_footer {
        justify-content: space-between;
    }
    
    .ae_modal_footer .ae_q_btn,
    .ae_modal_footer .tool-action-btn {
        flex: 1 1 calc(50% - 6px);
        box-sizing: border-box;
    }

    .ae_modal_body .ae_slider_group {
        flex-direction: column;
        align-items: stretch;
    }

    .ae_modal_body .ae_slider_group label {
        width: 100%;
        margin-bottom: 2px;
    }
}