/* 
   BLACKFADE PREMIUM V6 - THE PERFECT VERSION 
   Interactive Cards, Glassmorphism, 40px Rounds
*/

.macro-builder-wide {
    width: 95% !important;
    max-width: 1000px !important;
    padding: 0 !important;
    overflow: visible !important;
    background: rgba(10, 10, 12, 0.95) !important;
    -webkit-backdrop-filter: blur(30px) saturate(160%) !important;
    backdrop-filter: blur(30px) saturate(160%) !important;
    border-radius: 40px !important; /* Premium 40px Rounds */
    border: 1px solid rgba(220, 38, 38, 0.25) !important;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.9) !important;
}

.macro-grid-container {
    display: grid !important;
    grid-template-columns: 1.2fr 0.8fr !important;
    min-height: 520px !important;
}

.macro-column {
    padding: 2.5rem !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
}

.bg-dimmed {
    background: rgba(220, 38, 38, 0.04) !important;
    border-left: 1px solid rgba(255, 255, 255, 0.05) !important;
}

/* Header centered */
.modal-header {
    justify-content: center !important;
    position: relative !important;
    padding: 2.5rem 2rem 2rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.modal-header h2 {
    font-size: 1.6rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 3px !important;
    color: white !important;
    margin: 0 !important;
}

.modal-header .close-btn {
    position: absolute !important;
    top: 2rem !important;
    right: 2rem !important;
    color: #94a3b8 !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
}

.back-arrow-btn {
    position: absolute !important;
    top: 2rem !important;
    left: 2rem !important;
    color: #94a3b8 !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.back-arrow-btn:hover {
    color: white !important;
    transform: translateX(-3px) !important;
}

/* Interactive Listing Cards */
.mini-macro-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    max-height: 180px !important; /* Reverted to original */
    overflow-y: auto !important;
    overflow-x: hidden !important; /* Prevent horizontal scroll */
    padding-right: 5px !important;
}

.macro-manage-item {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
    border-radius: 12px !important;
    padding: 8px 12px !important; /* Shrink padding */
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.macro-manage-item .macro-info span {
    font-size: 0.85rem !important; /* Smaller text */
}

.macro-manage-item .macro-info i {
    width: 14px !important;
    height: 14px !important;
}

.macro-manage-item:hover {
    background: rgba(220, 38, 38, 0.08) !important;
    border-color: rgba(220, 38, 38, 0.4) !important;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.1) !important;
}

.macro-info i {
    color: #dc2626 !important;
    filter: drop-shadow(0 0 5px rgba(220, 38, 38, 0.5)) !important;
}

/* Days List */
.days-list-minimal {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

.day-item {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 8px 15px !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    color: #94a3b8 !important;
    transition: all 0.2s ease !important;
}

.day-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    color: white !important;
}

.day-item:has(input:checked) span {
    color: #dc2626 !important;
    font-weight: 800 !important;
}

/* Clock Indicator (VIOLET HEARTBEAT) */
.macro-status-indicator.active {
    animation: macroPulseV4 2s infinite ease-in-out !important;
    color: #a78bfa !important;
    border-color: #a78bfa !important;
}

@keyframes macroPulseV4 {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 5px rgba(139, 92, 246, 0.4)); }
    50% { transform: scale(1.08); filter: drop-shadow(0 0 20px rgba(139, 92, 246, 0.6)); }
}

/* Simple Clean Inputs */
input[type="text"], select, input[type="time"] {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px !important;
    padding: 14px !important;
    color: white !important;
}

.btn-delete-macro {
    background: rgba(239, 68, 68, 0.05) !important;
    border: 1px solid rgba(239, 68, 68, 0.1) !important;
    color: rgba(239, 68, 68, 0.6) !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-delete-macro:hover {
    background: #dc2626 !important;
    color: white !important;
    border-color: #dc2626 !important;
    transform: rotate(90deg) scale(1.1) !important;
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.5) !important;
}

.btn-delete-macro i {
    width: 14px !important;
    height: 14px !important;
}

.btn-primary.full-width {
    background: #dc2626 !important;
    border-radius: 20px !important;
    height: 60px !important;
    font-weight: 800 !important;
    border: none !important;
    color: white !important;
    cursor: pointer !important;
}

.btn-secondary.full-width {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 20px !important;
    height: 54px !important;
    color: #94a3b8 !important;
    cursor: pointer !important;
}

.btn-add-action-compact {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%) !important;
    border-radius: 50% !important;
    width: 48px !important;
    height: 48px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    cursor: pointer !important;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4) !important;
}

.small-label {
    font-size: 0.75rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    color: #dc2626 !important;
    margin-bottom: 0.5rem !important;
    display: block !important;
    letter-spacing: 1.5px !important;
}

/* RESPONSIVE UPDATES FOR MACRO BUILDER */
@media (max-width: 768px) {
    .macro-builder-wide {
        width: 100% !important;
        height: 100% !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .macro-grid-container {
        grid-template-columns: 1fr !important;
        overflow-y: auto !important;
    }

    .macro-column {
        padding: 1.5rem !important;
    }

    .bg-dimmed {
        border-left: none !important;
        border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
    }

    .modal-header {
        padding: 1.5rem 1rem 1rem !important;
    }

    .modal-header h2 {
        font-size: 1.2rem !important;
        letter-spacing: 1px !important;
    }

    .modal-header .close-btn, .back-arrow-btn {
        top: 1.2rem !important;
    }

    .btn-primary.full-width, .btn-secondary.full-width {
        height: 50px !important;
        border-radius: 12px !important;
    }

    .macro-action-add-compact {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
    }

    .macro-action-add-compact select {
        flex: 1 !important;
        min-width: 120px !important;
    }
}

/* Fix search input padding overrides caused by global input styling in this stylesheet */
#filter-search {
    padding-left: 46px !important;
}
#task-search-input {
    padding-right: 40px !important;
}
#corbeille-search {
    padding-right: 40px !important;
}

/* Builder d'évènements : rangée machine / action / bouton, avec le nom de machine élargi */
#event-modal .macro-action-add-compact {
    display: flex;
    align-items: center;
    gap: 8px;
}
#event-modal #event-target-select {
    flex: 2 1 0;
    min-width: 0;
}
#event-modal #event-command-select {
    flex: 1 1 0;
    min-width: 0;
}
#event-modal .btn-add-action-compact {
    flex: 0 0 auto;
}


