/* Easy Label Admin Styles */

/* BARRA FILTRI RAPIDI - Posizionamento a tutta larghezza */
.content-labels-quick-filter-bar {
    clear: both !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: block !important;
    float: none !important;
    margin-bottom: 15px;
    padding: 12px;
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
}

/* REGOLE GENERALI PER LE COLONNE - SEMPLICI E FUNZIONALI */

/* Colonna Etichette: compatta */
.wp-list-table .column-content_label {
    width: 120px !important;
    overflow: visible !important;
}

/* Layout verticale per le etichette nella colonna */
.column-content_label .content-label-wrapper {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    align-items: flex-start !important;
}

/* Layout verticale per le etichette nella colonna (anche per title-labels-inline) */
.column-content_label .title-labels-inline {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    align-items: flex-start !important;
}

/* Forza overflow visible per permettere al dropdown di uscire dalla tabella */
.wp-list-table tbody tr,
.wp-list-table tbody tr td {
    overflow: visible !important;
}

/* Colonna Note: compatta */
.wp-list-table .column-content_note {
    width: 150px !important;
}

/* Stili per la pagina di amministrazione del plugin */
.content-labels-admin-page {
    max-width: none;
}

.content-labels-admin-page .nav-tab-wrapper {
    margin-bottom: 20px;
}

.content-labels-admin-page .form-table {
    max-width: 100%;
}

.content-labels-admin-page .form-table th {
    width: 200px;
    vertical-align: top;
    padding-top: 15px;
}

.content-labels-admin-page .form-table td {
    vertical-align: top;
    padding-top: 10px;
}

.content-labels-admin-page fieldset {
    margin: 0;
    padding: 0;
    border: none;
}

.content-labels-admin-page fieldset label {
    display: block;
    margin-bottom: 8px;
    font-weight: normal;
}

/* ===== PULSANTE AGGIUNGI ETICHETTA - VERSIONE PRO ===== */
.add-label-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 160px;
    margin: 30px 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #dee2e6;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.add-label-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 115, 170, 0.1), transparent);
    transition: left 0.6s;
}

.add-label-placeholder:hover::before {
    left: 100%;
}

/* ===== PULSANTE AGGIUNGI NUOVA ETICHETTA/WIDGET (PAGINA IMPOSTAZIONI) ===== */
#add-label.add-new-label-settings-btn,
#add-widget.add-new-label-settings-btn,
#add-label.add-label-btn {
    background: linear-gradient(135deg, #007cba 0%, #0073aa 50%, #005582 100%);
    border: none;
    border-radius: 20px;
    color: white;
    height: 5dvw;
    padding: 24px 48px;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 
        0 12px 40px rgba(0, 115, 170, 0.3),
        0 6px 16px rgba(0, 0, 0, 0.12),
        inset 0 2px 0 rgba(255, 255, 255, 0.25),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

#add-label.add-new-label-settings-btn::before,
#add-widget.add-new-label-settings-btn::before,
#add-label.add-label-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 1;
}

#add-label.add-new-label-settings-btn:hover,
#add-widget.add-new-label-settings-btn:hover,
#add-label.add-label-btn:hover {
    background: linear-gradient(135deg, #005582 0%, #003d5c 50%, #002942 100%);
    transform: translateY(-6px) scale(1.08);
    box-shadow: 
        0 16px 50px rgba(0, 115, 170, 0.45),
        0 10px 20px rgba(0, 0, 0, 0.2),
        inset 0 2px 0 rgba(255, 255, 255, 0.35),
        inset 0 -2px 0 rgba(0, 0, 0, 0.15);
    color: white;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

#add-label.add-new-label-settings-btn:hover::before,
#add-widget.add-new-label-settings-btn:hover::before,
#add-label.add-label-btn:hover::before {
    left: 100%;
}

#add-label.add-new-label-settings-btn:active,
#add-widget.add-new-label-settings-btn:active,
#add-label.add-label-btn:active {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 8px 30px rgba(0, 115, 170, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.15),
        inset 0 2px 0 rgba(255, 255, 255, 0.2),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
}

#add-label.add-new-label-settings-btn .dashicons,
#add-widget.add-new-label-settings-btn .dashicons,
#add-label.add-label-btn .dashicons {
    font-size: 22px;
    width: 22px;
    height: 22px;
    margin-top: -1px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
    position: relative;
    z-index: 2;
}

#add-label.add-new-label-settings-btn:focus,
#add-widget.add-new-label-settings-btn:focus,
#add-label.add-label-btn:focus {
    outline: none;
    box-shadow: 
        0 0 0 4px rgba(0, 115, 170, 0.4),
        0 12px 40px rgba(0, 115, 170, 0.3),
        0 6px 16px rgba(0, 0, 0, 0.12),
        inset 0 2px 0 rgba(255, 255, 255, 0.25),
        inset 0 -2px 0 rgba(0, 0, 0, 0.1);
}

/* Animazione per l'aggiunta delle nuove etichette e widget */
.label-editor-card.new-label,
.widget-editor-card.new-label {
    animation: slideInFromBottom 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: center bottom;
}

@keyframes slideInFromBottom {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Miglioramento hover del placeholder */
.add-label-placeholder:hover {
    border-color: #0073aa;
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
}

/* ===== STILI PER CHECKBOX POST TYPES NELLE ETICHETTE ===== */
.label-post-types {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e1e1e1;
}

.label-post-types-title {
    font-weight: 600;
    color: #23282d;
    margin-bottom: 12px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.label-post-types-title .dashicons {
    color: #0073aa;
    font-size: 16px;
}

.post-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.post-type-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: #f8f9fa;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
}

.post-type-checkbox:hover {
    background: #e8f4fd;
    border-color: #0073aa;
}

.post-type-checkbox input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
}

.post-type-checkbox input[type="checkbox"]:checked + .post-type-name {
    font-weight: 600;
    color: #0073aa;
}

.post-type-name {
    color: #555;
    font-size: 12px;
    transition: all 0.2s ease;
}

/* ===== STILI PER OPZIONE PERCENTUALE NELLE ETICHETTE ===== */
.label-percentage-option {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e5e5;
}

.label-checkbox-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 12px;
    background: #f8f9fa;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.label-checkbox-option:hover {
    background: #e8f4fd;
    border-color: #2271b1;
}

.label-checkbox-option input[type="checkbox"] {
    margin: 0;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.label-checkbox-option .checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #23282d;
}

.label-checkbox-option .dashicons {
    font-size: 18px;
}

.label-checkbox-option input[type="checkbox"]:checked ~ .checkbox-label {
    color: #2271b1;
}

.label-checkbox-option input[type="checkbox"]:checked ~ .checkbox-label strong {
    color: #135e96;
}

.content-label-wrapper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    position: relative;
}

.content-label-select {
    font-size: 12px;
}

/* Etichette esistenti */
.content-label-badge {
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center; /* Centra il contenuto orizzontalmente */
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

/* STILI LABEL IN COLONNA - UGUALI ALLE INLINE */
.column-content_label .content-label-badge {
    justify-content: center;
    text-align: center;
    transition: all 0.2s ease;
    padding: 1px 5px !important; /* IDENTICO agli inline */
    font-size: 9px !important; /* IDENTICO agli inline */
    border-radius: 8px !important; /* IDENTICO agli inline */
    font-weight: 500 !important; /* IDENTICO agli inline */
}

/* HOVER LABEL IN COLONNA - UGUALE ALLE INLINE */
.column-content_label .content-label-badge:hover {
    opacity: 0.8;
    transform: scale(0.95); /* IDENTICO agli inline */
}

/* STILI LABEL NEL METABOX - PIÙ GRANDI PER MIGLIORE LEGGIBILITÀ */
.metabox-labels .content-label-badge {
    justify-content: center;
    text-align: center;
    transition: all 0.2s ease;
    padding: 4px 10px !important; /* Larger than inline/column */
    font-size: 13px !important; /* Larger than inline/column */
    border-radius: 8px !important;
    font-weight: 500 !important;
}

/* HOVER LABEL IN METABOX */
.metabox-labels .content-label-badge:hover {
    opacity: 0.8;
    transform: scale(0.95);
}

/* Layout verticale per le label nel metabox */
.metabox-labels {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    align-items: flex-start !important;
}

/* Stile compatto - solo pallino colorato */
.content-label-badge.content-label-compact {
    padding: 0;
    min-width: auto;
    border-radius: 50%;
    font-size: 0; /* Hide text */
}

/* Inline dots (smaller) */
.inline-badge.content-label-compact {
    width: 16px !important;
    height: 16px !important;
    margin-right: 4px !important;
    display: inline-block !important;
    padding: 0 !important;
}

/* Column dots (larger) */
.column-content_label .content-label-compact {
    width: 20px !important;
    height: 20px !important;
    margin-right: 6px !important;
}

.content-label-badge.content-label-compact:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.content-label-badge:hover {
    opacity: 0.8;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.content-label-badge:hover::after {
    content: "✕";
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    border: 1px solid white;
}

/* NUOVO: Disabilita l'icona di eliminazione sui filtri rapidi */
.content-labels-quick-filter-bar .content-label-badge:hover::after {
    display: none !important;
}

/* Rimuove l'outline di focus sui NUOVI filtri badge */
.content-labels-quick-filter-bar .filter-badge,
.content-labels-quick-filter-bar .filter-badge:focus,
.content-labels-quick-filter-bar .filter-badge:active,
.content-labels-quick-filter-bar .filter-badge:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* Il bordo viene gestito inline per permettere personalizzazioni per tutte le label di default */
/* Rimosso: ora tutte le label (all, none, ecc.) possono avere bordi personalizzati */

/* Rimuove anche dai badge dentro i filtri (legacy) */
.content-labels-quick-filter-bar .content-label-badge,
.content-labels-quick-filter-bar .content-label-badge:focus,
.content-labels-quick-filter-bar .content-label-badge:active,
.content-labels-quick-filter-bar .content-label-badge:focus-visible {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* DRAG AND DROP per i filtri rapidi - SEMPLIFICATO */
.filter-badge {
    cursor: grab !important;
    pointer-events: auto !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    touch-action: none !important;
}

.filter-badge:active {
    cursor: grabbing !important;
}

/* Stati durante il drag */
.filter-badge.sortable-chosen {
    opacity: 0.8;
}

.filter-badge.sortable-ghost {
    opacity: 0.4;
}

/* Badge "Nessuna Label" - Colore gestito dalle impostazioni personalizzate inline */

/* DRAG AND DROP per i filtri rapidi */
.content-labels-quick-filter-bar .filter-wrapper {
    cursor: default;
}

.content-labels-quick-filter-bar .content-label-quick-filter.draggable {
    cursor: grab !important;
}

.content-labels-quick-filter-bar .content-label-quick-filter.draggable:active {
    cursor: grabbing !important;
}

/* Disabilita gli effetti sortable sui filtri per evitare interferenze con i link */
.content-labels-quick-filter-bar .content-label-quick-filter.sortable-ghost,
.content-labels-quick-filter-bar .content-label-quick-filter.sortable-chosen,
.content-labels-quick-filter-bar .content-label-quick-filter.sortable-drag {
    transform: none !important;
}

/* Stili per drag & drop delle etichette */
.content-label-wrapper.sortable-enabled {
    position: relative;
}

.content-label-badge.draggable {
    cursor: grab !important;
    position: relative;
    transition: all 0.2s ease;
}

.content-label-badge.draggable:active {
    cursor: grabbing !important;
}

/* NASCONDI tutti i pallini di drag and drop */
.content-label-badge.draggable::before {
    display: none !important;
}

/* NELLE COLONNE: ZERO pallini visibili come negli inline */
.column-content_label .content-label-badge.draggable::before {
    display: none !important;
}

/* Cursor grab su TUTTE le label quando draggable */
.content-label-badge.draggable {
    cursor: grab !important;
    position: relative;
    transition: all 0.2s ease;
}

.content-label-badge.draggable:active {
    cursor: grabbing !important;
}

.content-label-badge.sortable-ghost {
    opacity: 0.4;
    /* NESSUN transform per evitare resize */
}

.content-label-badge.sortable-chosen {
    /* NESSUN scale per evitare resize */
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3) !important;
}

.content-label-badge.sortable-drag {
    /* NESSUN rotate per evitare resize */
    box-shadow: 0 6px 12px rgba(0,0,0,0.4) !important;
}

/* DISABILITA COMPLETAMENTE tutti i sortable states per le colonne */
.column-content_label .content-label-badge.sortable-ghost,
.column-content_label .content-label-badge.sortable-chosen,
.column-content_label .content-label-badge.sortable-drag {
    transform: none !important;
    opacity: inherit !important;
    box-shadow: none !important;
    z-index: inherit !important;
}

/* Indicatore di drop zone */
.content-label-wrapper.sortable-enabled::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px dashed transparent;
    border-radius: 6px;
    pointer-events: none;
    transition: all 0.2s ease;
}

.content-label-wrapper.drop-active::after {
    border-color: #2271b1;
    background: rgba(34, 113, 177, 0.05);
}

/* Adjust padding for drag handle */
.content-label-badge.draggable {
    padding-left: 18px;
}

/* ===== PULSANTI + PER AGGIUNGERE ETICHETTE (COLONNE/INLINE) ===== */
.add-label-btn {
    background: linear-gradient(135deg, #0073aa 0%, #005582 100%);
    border: none;
    color: white !important;
    padding: 0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 
        0 2px 6px rgba(0, 115, 170, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.add-label-btn:hover {
    background: linear-gradient(135deg, #005582 0%, #003d5c 100%);
    transform: scale(1.15);
    box-shadow: 
        0 4px 12px rgba(0, 115, 170, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.15);
    color: white !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.add-label-btn:active {
    transform: scale(1.05);
    box-shadow: 
        0 2px 6px rgba(0, 115, 170, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Versioni specifiche per inline e metabox */
.inline-add-btn {
    width: 18px !important;
    height: 18px !important;
    font-size: 10px !important;
    margin-left: 4px;
}

/* Pulsante "+" nella colonna - UGUALE AGLI INLINE */
.column-content_label .add-label-btn {
    width: 18px !important;
    height: 18px !important;
    font-size: 10px !important;
    margin-left: 4px;
}

.metabox-add-btn {
    width: 28px !important;
    height: 28px !important;
    font-size: 16px !important;
}

/* Dropdown flottante */
/* Backdrop that captures clicks outside the dropdown */
#labels-dropdown-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99998; /* one below the dropdown */
    background: transparent;
}

.labels-dropdown {
    position: fixed !important;
    background: white;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
    z-index: 99999 !important;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    min-width: 200px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.labels-dropdown.show {
    display: block;
    opacity: 1;
}

/* Animazione quando appare sotto */
.labels-dropdown.show-below {
    transform-origin: top center;
    animation: slideDownFade 0.2s ease-out;
}

/* Animazione quando appare sopra */
.labels-dropdown.show-above {
    transform-origin: bottom center;
    animation: slideUpFade 0.2s ease-out;
}

@keyframes slideDownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.labels-dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f1;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s ease;
}

.labels-dropdown-item:last-child {
    border-bottom: none;
}

.labels-dropdown-item:hover {
    background: #f8f9fa;
}

.labels-dropdown-item.selected {
    background: #e7f3ff;
}

.labels-dropdown-item .label-color-preview {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.labels-dropdown-item .label-name {
    font-size: 12px;
    color: #23282d;
}

/* Confirm dialog styles */
.label-confirm-dialog {
    position: fixed;
    background: white;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 0;
    z-index: 100001;
    min-width: 280px;
    max-width: 350px;
    display: none;
    animation: fadeInScale 0.15s ease-out;
}

.label-confirm-dialog.show {
    display: block;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.confirm-dialog-header {
    padding: 16px;
    border-bottom: 1px solid #f0f0f1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.confirm-dialog-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #d63638;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.confirm-dialog-title {
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
    margin: 0;
}

.confirm-dialog-body {
    padding: 16px;
}

.confirm-dialog-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: #f6f7f7;
    border-radius: 4px;
    margin-bottom: 12px;
}

.confirm-dialog-label-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}

.confirm-dialog-label-name {
    font-size: 13px;
    color: #1d2327;
    font-weight: 500;
}

.confirm-dialog-note-preview {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: #f6f7f7;
    border-radius: 4px;
    margin-bottom: 12px;
    border-left: 3px solid #2271b1;
}

.confirm-dialog-note-icon {
    font-size: 18px;
    flex-shrink: 0;
    line-height: 1;
}

.confirm-dialog-note-text {
    font-size: 12px;
    color: #1d2327;
    line-height: 1.5;
    word-break: break-word;
    flex: 1;
    font-style: italic;
}

.confirm-dialog-message {
    font-size: 13px;
    color: #50575e;
    line-height: 1.5;
}

.confirm-dialog-footer {
    padding: 12px 16px;
    border-top: 1px solid #f0f0f1;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.confirm-dialog-btn {
    padding: 6px 16px;
    border-radius: 3px;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid;
    transition: all 0.2s ease;
    font-weight: 500;
}

.confirm-dialog-btn-cancel {
    background: white;
    border-color: #c3c4c7;
    color: #2c3338;
}

.confirm-dialog-btn-cancel:hover {
    background: #f6f7f7;
    border-color: #8c8f94;
}

.confirm-dialog-btn-remove {
    background: #d63638;
    border-color: #d63638;
    color: white;
}

.confirm-dialog-btn-remove:hover {
    background: #b32d2e;
    border-color: #b32d2e;
}

/* Stili specifici per le etichette inline accanto al titolo */
.title-labels-inline {
    position: relative;
}

.title-labels-inline .content-label-badge.inline-badge {
    transition: all 0.2s ease;
}

.title-labels-inline .content-label-badge.inline-badge:hover {
    opacity: 0.8;
    transform: scale(0.95);
}

.title-labels-inline .content-label-badge.inline-badge:hover::after {
    content: "✕";
    position: absolute;
    top: -6px;
    right: -6px;
    background: #dc3545;
    color: white;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    font-size: 8px;
    line-height: 12px;
    text-align: center;
    font-weight: bold;
    border: 1px solid white;
}

/* PULSANTE INLINE NEI TITOLI - Stili coerenti con colonne */
.title-labels-inline .add-label-btn.inline-add-btn {
    background: linear-gradient(135deg, #0073aa 0%, #005582 100%) !important;
    border: none !important;
    color: white !important;
    padding: 0 !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 18px !important;
    height: 18px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    box-shadow: 
        0 2px 6px rgba(0, 115, 170, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.1) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
    z-index: 1 !important;
    margin-left: 4px !important;
}

.title-labels-inline .add-label-btn.inline-add-btn:hover {
    background: linear-gradient(135deg, #005582 0%, #003d5c 100%) !important;
    border: none !important;
    color: white !important;
    transform: scale(1.15) !important;
    box-shadow: 
        0 4px 12px rgba(0, 115, 170, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.15) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;
}

.title-labels-inline .add-label-btn.inline-add-btn:active {
    background: linear-gradient(135deg, #005582 0%, #003d5c 100%) !important;
    transform: scale(1.05) !important;
    box-shadow: 
        0 2px 6px rgba(0, 115, 170, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.title-labels-inline .labels-dropdown.inline-dropdown {
    position: absolute !important;
    top: calc(100% + 2px) !important;
    left: 0 !important;
    background: white !important;
    border: 1px solid #ccd0d4 !important;
    border-radius: 4px !important;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15) !important;
    max-height: 300px !important;
    overflow-y: auto !important;
    margin-top: 0 !important;
    font-size: 11px !important;
    z-index: 9999 !important;
    display: none !important;
}

.title-labels-inline .labels-dropdown.inline-dropdown.show {
    display: block !important;
}

/* Assicuriamoci che il titolo abbia la giusta altezza per contenere le etichette */
.wp-list-table .row-title {
    line-height: 1.5;
    min-height: 20px;
}

/* Nascondi gli hover effects standard sulle etichette inline */
.title-labels-inline .content-label-badge:not(:hover)::after {
    display: none;
}

.content-note-wrapper {
    position: relative;
}

.content-note-field {
    width: 100%;
    font-size: 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 4px 6px;
}

.content-note-field:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}

.content-note-save {
    margin-top: 4px;
    font-size: 11px;
    padding: 2px 8px;
    height: auto;
    line-height: 1.4;
}

.content-note-clear {
    margin-top: 4px;
    font-size: 11px;
    padding: 2px 8px;
    height: auto;
    line-height: 1.4;
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.content-note-clear:hover {
    background-color: #c82333;
    border-color: #bd2130;
    color: white;
}

.content-note-buttons {
    display: flex;
    gap: 5px;
    margin-top: 4px;
}

/* Meta box styles */
#content-labels-meta-box .form-table th {
    padding: 8px 0;
    font-weight: 500;
}

#content-labels-meta-box .form-table td {
    padding: 8px 0;
}

#content-labels-meta-box select,
#content-labels-meta-box textarea {
    border-radius: 3px;
}

/* Column width adjustments - now dynamic via PHP */
/* Widths are set via wp_add_inline_style in PHP */

/* Loading states */
.content-label-wrapper.loading,
.content-note-wrapper.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Success/error messages */
.content-labels-message {
    position: fixed;
    top: 32px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 10px 15px;
    border-radius: 3px;
    z-index: 10000;
    font-size: 13px;
    animation: slideIn 0.3s ease-out;
}

.content-labels-message.error {
    background: #dc3545;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive adjustments */
@media screen and (max-width: 782px) {
    .content-label-wrapper {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .content-label-select {
        width: 100%;
        margin-bottom: 4px;
    }
    
    .content-note-field {
        width: 100%;
    }
}

/* Admin page specific styles */
.content-labels-admin-page .wp-list-table {
    margin-top: 10px;
}

.content-labels-admin-page .label-row input[type="text"] {
    width: 100%;
}

.content-labels-admin-page .label-row input[type="color"] {
    width: 50px;
    height: 35px;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
}

.content-labels-admin-page .label-preview {
    min-width: 80px;
    padding: 6px 12px;
    border-radius: 15px;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
}

/* PULSANTE RIMUOVI ETICHETTA - Stile moderno */
.content-labels-admin-page .button.remove-label {
    background: linear-gradient(135deg, #dc3545 0%, #bd2130 100%);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 2px 6px rgba(220, 53, 69, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.content-labels-admin-page .button.remove-label::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.content-labels-admin-page .button.remove-label:hover {
    background: linear-gradient(135deg, #c82333 0%, #a61e2a 100%);
    transform: translateY(-2px);
    box-shadow: 
        0 4px 12px rgba(220, 53, 69, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.15);
}

.content-labels-admin-page .button.remove-label:hover::before {
    left: 100%;
}

.content-labels-admin-page .button.remove-label:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 6px rgba(220, 53, 69, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Stili per etichetta placeholder "Non Assegnata" */
.content-label-placeholder {
    background-color: #f0f0f1 !important;
    color: #8c8f94 !important;
    border: 1px dashed #c3c4c7 !important;
    font-style: italic;
}

.content-label-placeholder.clickable:hover {
    background-color: #e8e9ea !important;
    transform: none;
    box-shadow: none;
}

/* Stili specifici per il pulsante "Aggiungi Nuova Etichetta" nella pagina admin */
.content-labels-admin-page .add-label-placeholder {
    margin: 15px 0;
    text-align: center;
}

/* PULSANTE AGGIUNGI ETICHETTA PRINCIPALE - Design Professionale */
.content-labels-admin-page .add-label-btn {
    background: linear-gradient(135deg, #0073aa 0%, #005582 100%);
    border: none;
    color: white;
    padding: 14px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 
        0 4px 16px rgba(0, 115, 170, 0.25),
        0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.content-labels-admin-page .add-label-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    transition: left 0.6s;
}

.content-labels-admin-page .add-label-btn:hover {
    background: linear-gradient(135deg, #005582 0%, #003d5c 100%);
    transform: translateY(-3px);
    box-shadow: 
        0 6px 20px rgba(0, 115, 170, 0.35),
        0 4px 12px rgba(0, 0, 0, 0.15);
}

.content-labels-admin-page .add-label-btn:hover::before {
    left: 100%;
}

.content-labels-admin-page .add-label-btn:active {
    transform: translateY(-1px);
    box-shadow: 
        0 4px 16px rgba(0, 115, 170, 0.25),
        0 2px 8px rgba(0, 0, 0, 0.1);
}

.content-labels-admin-page .add-label-btn:focus {
    outline: none;
    box-shadow: 
        0 4px 16px rgba(0, 115, 170, 0.25),
        0 2px 8px rgba(0, 0, 0, 0.1),
        0 0 0 3px rgba(0, 115, 170, 0.3);
}

.content-labels-admin-page .add-label-btn .dashicons {
    font-size: 16px;
    line-height: 1;
    margin: 0;
}

/* ========================================
   QUICK CREATE LABEL MODAL - v1.1.0
   ======================================== */

/* Modal overlay */
.redshape-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
}

.redshape-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

/* Modal content */
.redshape-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.2s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Modal header */
.redshape-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e5e5;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
}

.redshape-modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1d2327;
}

.redshape-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #646970;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.redshape-modal-close:hover {
    background: #f0f0f1;
    color: #1d2327;
}

/* Modal body */
.redshape-modal-body {
    padding: 24px;
}

/* Form fields */
.redshape-form-field {
    margin-bottom: 20px;
}

.redshape-form-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1d2327;
    font-size: 14px;
}

.redshape-form-field input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.redshape-form-field input[type="text"]:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

/* Color picker */
.redshape-color-picker {
    display: flex;
    align-items: center;
    gap: 12px;
}

.redshape-color-picker input[type="color"] {
    width: 60px;
    height: 40px;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
}

.redshape-color-picker .color-preview {
    width: 40px;
    height: 40px;
    border-radius: 20px;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.redshape-color-picker input[type="color"]:hover + .color-preview {
    transform: scale(1.1);
}

/* Modal info */
.redshape-modal-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: #e7f5fe;
    border-left: 4px solid #2271b1;
    border-radius: 4px;
    margin-top: 20px;
}

.redshape-modal-info .dashicons {
    color: #2271b1;
    flex-shrink: 0;
    margin-top: 2px;
}

.redshape-modal-info p {
    margin: 0;
    font-size: 13px;
    color: #1d2327;
    line-height: 1.5;
}

/* Modal footer */
.redshape-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e5e5e5;
    background: #f8f9fa;
}

.redshape-modal-footer .button {
    padding: 8px 16px;
    font-size: 14px;
    height: auto;
    line-height: 1.4;
}

/* Create new label option in dropdown */
.create-new-label-option {
    cursor: pointer !important;
    border-bottom: 2px solid #ddd !important;
    margin-bottom: 8px !important;
    padding: 8px 10px !important;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%) !important;
    border-radius: 4px 4px 0 0 !important;
    transition: all 0.2s ease !important;
    position: relative !important;
}

.create-new-label-option:hover {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(0, 163, 42, 0.2) !important;
}

.create-new-label-option:active {
    transform: translateY(0) !important;
}

.create-new-label-option .label-color-preview {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 18px !important;
    height: 18px !important;
    border-radius: 50% !important;
    box-shadow: 0 2px 4px rgba(0, 163, 42, 0.3) !important;
}

.create-new-label-option .label-name {
    font-weight: 600 !important;
    color: #16a34a !important;
    font-size: 13px !important;
}

/* Responsive */
@media screen and (max-width: 782px) {
    .redshape-modal-content {
        width: 95%;
        max-width: none;
    }
    
    .redshape-modal-header,
    .redshape-modal-body,
    .redshape-modal-footer {
        padding: 16px;
    }
    
    .redshape-modal-footer {
        flex-direction: column;
        gap: 8px;
    }
    
    .redshape-modal-footer .button {
        width: 100%;
    }
}

