/* Custom styles for Scenario Manager */

/* Fix for extra padding in modal */
.modal-open {
    padding-right: 0 !important;
}

/* Card hover effect */
.card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Badge styling */
.badge {
    font-weight: 400;
    padding: 0.35em 0.65em;
}

/* Improve table responsiveness */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Form improvements */
.form-control:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.invalid-feedback {
    display: block;
}

/* Better spacing for flash messages */
.alert {
    margin-bottom: 1.5rem;
}

/* Improve code readability */
pre, code {
    border-radius: 4px;
    background-color: #212529;
    color: #e9ecef;
    padding: 0.2rem 0.4rem;
}

/* Improved footer */
footer {
    margin-top: 3rem;
}

/* Better spacing for buttons in tables */
.btn-group {
    display: flex;
    gap: 0.25rem;
}

/* Custom styling for page headers */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
}

/* Description text in cards */
.card-text {
    color: #adb5bd;
}

.drag-handle {
    cursor: grab;
}

.ui-sortable-helper {
    display: table;
    background-color: #212529 !important;
    color: white !important;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.ui-sortable-placeholder {
    visibility: visible !important;
    background-color: #f8f9fa;
    border: 2px dashed #dee2e6;
    height: 60px;
}

/* Toast styling */
.toast {
    min-width: 250px;
}

/* Type group styling */
.sound-type-group {
    margin-bottom: 2rem;
    border: 1px solid #444;
    border-radius: 8px;
    overflow: hidden;
}

.sound-type-header {
    background-color: #343a40;
    color: white;
    padding: 10px 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sound-type-scenario .sound-type-header {
    background-color: #0d6efd;
}

.sound-type-faq .sound-type-header {
    background-color: #6f42c1;
}

.sound-type-replay .sound-type-header {
    background-color: #fd7e14;
}

.sound-type-waiting .sound-type-header {
    background-color: #20c997;
}

/* Type badges */
.type-badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: normal;
}

.type-badge-scenario {
    background-color: #0d6efd;
}

.type-badge-faq {
    background-color: #6f42c1;
}

.type-badge-replay {
    background-color: #fd7e14;
}

.type-badge-waiting {
    background-color: #20c997;
}

.accordion-body{
    border: #d4d0ef 2px solid;
}

/* Styles pour le drag and drop */
.ui-sortable-helper {
    display: table;
    background-color: #f8f9fa;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    opacity: 0.9;
    border: 1px solid #dee2e6;
}

.ui-sortable-placeholder {
    visibility: visible !important;
    background-color: #e9ecef;
    border: 2px dashed #adb5bd;
    height: 60px;
    margin-bottom: 5px;
}

.drag-handle {
    cursor: grab;
}

.drag-handle:active {
    cursor: grabbing;
}

/* Styles pour Sortable.js */
.sortable-ghost {
    opacity: 0.4;
    background-color: #e9ecef;
}

.sortable-chosen {
    background-color: #fff3cd;
}

.sortable-drag {
    transform: rotate(5deg);
}

/* Animation pour les accordéons */
.accordion-collapse {
    transition: all 0.3s ease;
}

/* Highlight de la ligne active */
.sound-row.highlight {
    background-color: #e7f5ff !important;
}

/* Animation pour les mises à jour AJAX */
.fade-update {
    transition: opacity 0.3s ease-in-out;
}
.fade-update.updating {
    opacity: 0.5;
}

/* Bouton de chargement */
.btn-loading .spinner-border {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
}


.step-nav {
    position: sticky;
    top: 25%;
}

.step-nav button {
    position: relative;
    z-index: 2;
    border-radius: 8px !important;
    margin-bottom: 15px;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.step-nav button.active {
    background-color: #1f7980 !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(25, 135, 84, 0.3);
}

.step-nav button:hover:not(.active) {
    background-color: #f8f9fa;
    transform: translateX(5px);
}

/* Style pour le bouton de lecture */
#playSplitAudio i {
    pointer-events: none;
}

/* Style pour le spectre audio */
#audioSpectrum {
    width: -webkit-fill-available;
    background-color: #1f7980 !important;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(31, 121, 128, 0.2);
}

/* Style pour le slider de split */
#splitPoint {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    -webkit-appearance: none;
}

#splitPoint::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: #1f7980;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(31, 121, 128, 0.3);
    transition: all 0.2s ease;
}

#splitPoint::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(31, 121, 128, 0.4);
}

#splitPoint::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #1f7980;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(31, 121, 128, 0.3);
    transition: all 0.2s ease;
    border: none;
}

#splitPoint::-moz-range-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(31, 121, 128, 0.4);
}

/* Style pour le conteneur du spectre */
.spectrum-container {
    position: relative;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* Style pour le temps affiché */
#splitTime {
    color: #1f7980;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Indicateur de chargement */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 15px 0;
    transition: opacity 0.3s;
}

.loading-indicator.d-none {
    display: none;
}

.loading-indicator p {
    margin-top: 10px;
    color: #666;
    font-style: italic;
}

/* Animation du spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Action builder --- */
.action-tree-wrapper .action-tree-surface {
    background: rgba(255, 255, 255, 0.02);
}
.action-node {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}
.action-params-block {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    font-size: 12px;
    max-height: 180px;
    overflow: auto;
    margin: 0;
    padding: 8px 10px;
}
.action-edge {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.08);
}
.action-flyover {
    position: fixed;
    inset: 0;
    z-index: 2050;
    display: flex;
    align-items: center;
    justify-content: center;
}
.action-flyover-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
}
.action-flyover-card {
    position: relative;
    width: min(480px, 92vw);
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}