/* ==========================================================================
   DELTAVOICE MCP - COMPONENTI ADMIN GLOBALI
   ========================================================================== */


/* --------------------------------------------------------------------------
   Help / Tooltip
   Utilizzo:
   <span class="dv-help" data-help="Descrizione...">?</span>
   -------------------------------------------------------------------------- */

.dv-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 18px;
    height: 18px;

    margin-left: 7px;

    border: 1px solid currentColor;
    border-radius: 50%;

    font-size: 12px;
    font-weight: 700;
    line-height: 1;

    cursor: help;
    position: relative;

    vertical-align: middle;
    opacity: .85;
}

.dv-help:hover {
    opacity: 1;
}

.dv-help::after {
    content: attr(data-help);

    position: absolute;
    z-index: 10000;

    left: 50%;
    bottom: calc(100% + 9px);

    transform: translateX(-50%);

    width: max-content;
    max-width: 340px;

    padding: 9px 12px;

    background: #111;
    color: #fff;

    border: 1px solid #555;
    border-radius: 6px;

    font-size: 12px;
    font-weight: normal;
    line-height: 1.4;

    white-space: normal;

    box-shadow: 0 4px 12px rgba(0, 0, 0, .35);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity .15s ease,
        visibility .15s ease;
}

.dv-help:hover::after {
    opacity: 1;
    visibility: visible;
}


/* ==========================================================================
   AZIONI MODULO
   ========================================================================== */

.moduleaction-inline {
    margin-top: 28px;
}

.moduleaction-header h2 {
    display: flex;
    align-items: center;
    margin: 0;
}

.moduleaction-table {
    width: 100%;
    overflow: hidden;
}

.moduleaction-row {
    display: grid;

    grid-template-columns:
        minmax(140px, 1fr)
        minmax(130px, .9fr)
        minmax(220px, 1.7fr)
        minmax(105px, .55fr)
        minmax(70px, .4fr)
        48px;

    gap: 12px;
    align-items: center;

    width: 100%;
    box-sizing: border-box;

    padding: 10px 8px;

    border-bottom: 1px solid var(--hairline-color);
}

.moduleaction-row-head {
    padding-top: 12px;
    padding-bottom: 8px;

    font-weight: 600;
    color: var(--body-quiet-color);
}

.moduleaction-cell {
    min-width: 0;
}

.moduleaction-cell input[type="text"],
.moduleaction-cell input[type="number"],
.moduleaction-cell select,
.moduleaction-cell textarea {
    width: 100%;
    max-width: 100%;

    box-sizing: border-box;
}

.moduleaction-cell textarea {
    min-height: 44px;
    height: 44px;

    resize: vertical;
}

.moduleaction-default {
    display: flex;
    justify-content: center;
    align-items: center;
}

.moduleaction-delete-col {
    display: flex;
    justify-content: center;
    align-items: center;
}

.moduleaction-delete-field {
    display: none;
}

.moduleaction-delete-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;

    padding: 0;

    border: 1px solid #dc3545;
    border-radius: 5px;

    background: transparent;
    color: #dc3545;

    font-size: 17px;

    cursor: pointer;
}

.moduleaction-delete-button:hover {
    background: #dc3545;
    color: #fff;
}

.moduleaction-row.pending-delete {
    opacity: .35;
}

.moduleaction-row.pending-delete .moduleaction-delete-button {
    background: #dc3545;
    color: #fff;
}

.moduleaction-row.empty-form,
.moduleaction-row[id$="-empty"],
.moduleaction-row[id*="__prefix__"] {
    display: none !important;
}

.moduleaction-add-row {
    padding: 12px 8px;
}


/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1200px) {

    .moduleaction-row {
        grid-template-columns:
            minmax(120px, 1fr)
            minmax(110px, .9fr)
            minmax(180px, 1.4fr)
            90px
            65px
            42px;

        gap: 7px;
    }
}


@media (max-width: 850px) {

    .moduleaction-row-head {
        display: none;
    }

    .moduleaction-row {
        display: grid;

        grid-template-columns: 1fr 1fr;

        gap: 10px;

        margin-bottom: 14px;
        padding: 14px;

        border: 1px solid var(--hairline-color);
        border-radius: 6px;
    }

    .moduleaction-cell {
        grid-column: span 1;
    }

    .moduleaction-cell.field-description {
        grid-column: 1 / -1;
    }

    .moduleaction-default {
        justify-content: flex-start;
    }

    .moduleaction-delete-col {
        justify-content: flex-end;
    }
}


/* ==========================================================================
   DELTAVOICE HELP ICON - STANDARD PROGETTO
   ========================================================================== */

.inline-group h2 .dv-help,
.dv-help {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;

    margin-left: 8px !important;
    padding: 0 !important;

    box-sizing: border-box !important;

    border: 2px solid currentColor !important;
    border-radius: 50% !important;

    background: rgba(255, 255, 255, 0.12) !important;

    color: inherit !important;

    font-family: Arial, sans-serif !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 16px !important;

    cursor: help !important;

    position: relative !important;
    vertical-align: middle !important;

    opacity: 1 !important;
}


/* Evidenziazione al passaggio del mouse */

.inline-group h2 .dv-help:hover,
.dv-help:hover {
    background: rgba(255, 255, 255, 0.28) !important;
    transform: scale(1.08);
}


/* Tooltip */

.inline-group h2 .dv-help::after,
.dv-help::after {
    content: attr(data-help) !important;

    position: absolute !important;
    z-index: 99999 !important;

    left: 0 !important;
    bottom: calc(100% + 10px) !important;

    width: 300px !important;
    max-width: 70vw !important;

    padding: 10px 12px !important;

    box-sizing: border-box !important;

    background: #111 !important;
    color: #fff !important;

    border: 1px solid #666 !important;
    border-radius: 6px !important;

    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 1.4 !important;

    text-align: left !important;
    text-transform: none !important;
    white-space: normal !important;

    box-shadow: 0 5px 18px rgba(0, 0, 0, .45) !important;

    opacity: 0 !important;
    visibility: hidden !important;

    pointer-events: none !important;
}


/* Mostra tooltip */

.inline-group h2 .dv-help:hover::after,
.dv-help:hover::after {
    opacity: 1 !important;
    visibility: visible !important;
}


/* ==========================================================================
   DELTAVOICE HELP ICON
   Standard informativo del progetto
   ========================================================================== */

.dv-help-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;

    margin-left: 8px !important;

    box-sizing: border-box !important;

    border: 2px solid rgba(255,255,255,.9) !important;
    border-radius: 50% !important;

    background: rgba(255,255,255,.12) !important;
    color: #fff !important;

    font-family: Arial, sans-serif !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1 !important;

    position: relative !important;
    vertical-align: middle !important;

    cursor: help !important;
}

.dv-help-icon:hover,
.dv-help-icon:focus {
    background: rgba(255,255,255,.28) !important;
    outline: none !important;
}

.dv-help-icon::after {
    content: attr(data-help);

    position: absolute;
    z-index: 100000;

    left: 0;
    bottom: calc(100% + 10px);

    width: 320px;
    max-width: 70vw;

    padding: 10px 12px;

    box-sizing: border-box;

    background: #111;
    color: #fff;

    border: 1px solid #666;
    border-radius: 6px;

    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;

    text-align: left;
    white-space: normal;

    box-shadow: 0 5px 18px rgba(0,0,0,.5);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.dv-help-icon:hover::after,
.dv-help-icon:focus::after {
    opacity: 1;
    visibility: visible;
}


/* Template tecnico Django */
.dv-empty-form,
.form-row[id$="-empty"],
.form-row:has([name*="__prefix__"]) {
    display: none !important;
}
