/* Variabili per Tema Dark e Accento */
:root {
    --accent-color: #A959FF;
    --accent-color-hover: #bd85ff;
    --bg-sidebar: #111115;
    --bg-main: #111115;
    --card-bg: #23232b;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --border-color: rgba(255, 255, 255, 0.08);
    --bs-dark-rgb: 35, 35, 43;
    --bs-dark: #23232b;
    --bs-body-bg: #23232b;
    color-scheme: dark;
}

/* Base Styles */
body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-main) !important;
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Stile per select e menu a tendina nativi */
.form-select, select {
    color-scheme: dark;
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

.form-select option, select option {
    background-color: var(--card-bg) !important;
    color: var(--text-primary) !important;
}

/* Custom Utilities */
.accent-color {
    color: var(--accent-color) !important;
}

.bg-accent {
    background-color: var(--accent-color) !important;
}


.subtle-border {
    border-color: var(--border-color) !important;
}

.border-accent {
    border-top-color: var(--accent-color) !important;
}

.pulse-danger {
    position: relative;
    animation: pulse-danger-animation 2s infinite;
}

.pulse-warning {
    position: relative;
    animation: pulse-warning-animation 2s infinite;
}

.pulse-success {
    position: relative;
    animation: pulse-success-animation 2s infinite;
}

.pulse-accent {
    position: relative;
    animation: pulse-accent-animation 2s infinite;
}

.pulse-info {
    position: relative;
    animation: pulse-info-animation 2s infinite;
}

@keyframes pulse-success-animation {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(25, 135, 84, 0.6);
    }

    70% {
        transform: scale(1.03);
        box-shadow: 0 0 0 10px rgba(25, 135, 84, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(25, 135, 84, 0);
    }
}

@keyframes pulse-info-animation {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(13, 202, 240, 0.6);
    }

    70% {
        transform: scale(1.03);
        box-shadow: 0 0 0 10px rgba(13, 202, 240, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(13, 202, 240, 0);
    }
}

@keyframes pulse-danger-animation {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 0, 54, 0.6);
    }

    70% {
        transform: scale(1.03);
        box-shadow: 0 0 0 10px rgba(255, 0, 54, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 0, 54, 0);
    }
}

@keyframes pulse-warning-animation {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(246, 255, 0, 0.55);
        /* warning */
    }

    70% {
        transform: scale(1.03);
        box-shadow: 0 0 0 12px rgba(246, 255, 0, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(246, 255, 0, 0);
    }
}

@keyframes pulse-accent-animation {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(169, 89, 255, 0.55);
        /* warning */
    }

    70% {
        transform: scale(1.03);
        box-shadow: 0 0 0 12px rgba(169, 89, 255, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(169, 89, 255, 0);
    }
}

.extra-small {
    font-size: 0.65rem;
}


.backdrop-blur-sm {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Sidebar Styling */
#sidebar {
    min-width: 250px;
    max-width: 250px;
    background-color: var(--bg-sidebar) !important;
    min-height: 100vh;
    transition: all 0.3s ease;
}

    #sidebar.active {
        margin-left: -250px;
    }

.sidebar-header {
    background-color: transparent;
}

    .sidebar-header img {
        /* Trasforma qualsiasi colore del logo in bianco puro */
        filter: brightness(0) invert(1);
    }

#sidebar ul.components {
    padding: 20px 0;
}

#sidebar ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 500;
}

    #sidebar ul li a:hover {
        color: var(--text-primary);
        background: rgba(255, 255, 255, 0.05);
    }

    #sidebar ul li a.active {
        color: var(--accent-color) !important;
        background-color: transparent !important;
    }

        #sidebar ul li a.active i {
            color: var(--accent-color) !important;
        }

/* Custom Main Components */
#content {
    background-color: var(--bg-main) !important;
    min-height: 100vh;
    transition: all 0.3s ease;
}

.navbar {
    background-color: var(--bg-sidebar) !important;
}

/* Tooltip*/
.tooltipster-sidetip.tooltipster-punk .tooltipster-box {
    border-bottom: 3px solid var(--accent-color);
}

.tooltipster-sidetip.tooltipster-punk.tooltipster-top .tooltipster-arrow-border {
    border-top-color: var(--accent-color);
}

/* Cards */
.custom-card {
    background-color: var(--card-bg) !important;
    border-radius: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/*   .custom-card:hover {
       transform: translateY(-5px);
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4) !important;
    }*/

        .icon-box {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background-color: rgba(169, 89, 255, 0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* Buttons */
.btn-custom {
    background-color: var(--accent-color);
    color: #000;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1.2rem;
    transition: all 0.2s;
}

    .btn-custom:hover {
        background-color: var(--accent-color-hover);
        transform: scale(1.02);
    }

.btn-outline-light {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

    .btn-outline-light:hover {
        background-color: var(--border-color);
        color: var(--text-primary);
    }

.badge-cta {
    transition: all 0.2s ease;
}

    .badge-cta:hover {
        transform: scale(1.05);
        box-shadow: 0 0 10px rgba(204, 255, 0, 0.4);
    }

/* Table */
.table-dark {
    --bs-table-bg: var(--card-bg);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
    border-color: var(--border-color);
}

.table thead,
.table thead th,
.table th,
.table-dark-subtle th {
    background-color: #23232b !important;
    --bs-table-bg: #23232b;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
}

.table > :not(caption) > * > * {
    padding: 1rem 0.5rem;
}

td .badge {
    font-weight: 500;
}

/* Chart Canvas adjustments */
canvas {
    max-height: 300px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #sidebar {
        margin-left: -250px;
        position: fixed;
        z-index: 1051; /* Sopra la navbar e l'overlay */
    }

        #sidebar.active {
            margin-left: 0;
        }

    #sidebarCollapse {
        display: inline-block;
    }

    .overlay {
        display: none;
        position: fixed;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.7);
        z-index: 1050; /* Sotto la sidebar ma sopra tutto il resto */
        opacity: 0;
        transition: all 0.5s ease-in-out;
    }

        .overlay.active {
            display: block;
            opacity: 1;
        }
}

/* Sovrascrittura Colori di Default Bootstrap */
.text-success, .text-success-emphasis {
    color: #84FF00 !important;
}
.text-warning, .text-warning-emphasis {
    color: #F6FF00 !important;
}
.text-danger, .text-danger-emphasis {
    color: #FF0036 !important;
}

.bg-success {
    background-color: #84FF00 !important;
    color: #000000 !important;
}
.bg-warning {
    background-color: #F6FF00 !important;
    color: #000000 !important;
}
.bg-danger {
    background-color: #FF0036 !important;
    color: #ffffff !important;
}

.bg-success-subtle {
    background-color: rgba(132, 255, 0, 0.12) !important;
    color: #84FF00 !important;
}
.bg-warning-subtle {
    background-color: rgba(246, 255, 0, 0.12) !important;
    color: #F6FF00 !important;
}
.bg-danger-subtle {
    background-color: rgba(255, 0, 54, 0.12) !important;
    color: #FF0036 !important;
}

.border-success, .border-success-subtle {
    border-color: rgba(132, 255, 0, 0.3) !important;
}
.border-warning, .border-warning-subtle {
    border-color: rgba(246, 255, 0, 0.3) !important;
}
.border-danger, .border-danger-subtle {
    border-color: rgba(255, 0, 54, 0.3) !important;
}

/* Quick Contact Widget */
.quick-contact-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1050;
    font-family: 'Outfit', sans-serif;
}

.quick-contact-fab {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color) 0%, #7d35db 100%);
    box-shadow: 0 8px 25px rgba(169, 89, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.quick-contact-fab i {
    font-size: 1.65rem;
    transition: transform 0.3s ease;
}

.quick-contact-fab:hover {
    transform: scale(1.08) translateY(-3px);
    box-shadow: 0 12px 30px rgba(169, 89, 255, 0.6);
}

.quick-contact-fab.active {
    transform: rotate(45deg);
}

/* Pulsing effect */
.quick-contact-fab::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
    top: 0;
    left: 0;
    animation: fab-pulse 2s infinite;
    opacity: 0;
    pointer-events: none;
}

@keyframes fab-pulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* Card Panel */
.quick-contact-panel {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 360px;
    max-width: calc(100vw - 60px);
    background: rgba(26, 26, 26, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    padding: 24px;
    transform: translateY(30px) scale(0.9);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    transform-origin: bottom right;
}

.quick-contact-panel.show {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

.quick-contact-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.quick-contact-header h5 {
    margin: 0;
    font-weight: 700;
    font-size: 1.15rem;
    color: #fff;
}

.quick-contact-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.quick-contact-close:hover {
    color: #fff;
}

.quick-contact-panel p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

.quick-contact-form .form-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.quick-contact-form .form-control {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 0.875rem;
    border-radius: 8px;
    padding: 8px 12px;
}

.quick-contact-form .form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(169, 89, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.quick-contact-form .btn-submit {
    background: var(--accent-color);
    color: #000;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    border-radius: 8px;
    padding: 10px;
    width: 100%;
    margin-top: 10px;
    transition: all 0.2s;
}

.quick-contact-form .btn-submit:hover {
    background: var(--accent-color-hover);
    transform: translateY(-1px);
}

/* Success State */
.quick-contact-success {
    display: none;
    text-align: center;
    padding: 20px 10px;
}

.quick-contact-success .success-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(169, 89, 255, 0.15);
    color: var(--accent-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 15px;
}

/* Time Slot Picker Grid */
.time-slots-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    max-height: 150px;
    overflow-y: auto;
    padding: 4px;
}

.time-slot-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 0.8rem;
    padding: 6px 0;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.time-slot-btn:hover {
    background: rgba(169, 89, 255, 0.15);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.time-slot-btn.selected {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #000;
    font-weight: 600;
}

/* Hint Tile & Drill-down Visual Cues */
.hint-bar {
    background: linear-gradient(90deg, rgba(169, 89, 255, 0.12), rgba(169, 89, 255, 0.02));
    border-left: 3px solid var(--accent-color);
    padding: 7px 12px;
    border-radius: 0 6px 6px 0;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.donut-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.donut-center-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 5;
    pointer-events: auto;
    transition: opacity 0.3s ease;
    width: 140px;
    padding: 0 4px;
}

.donut-center-channel-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
    margin-bottom: 6px;
    word-break: break-word;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.donut-center-btn {
    font-size: 0.72rem;
    padding: 4px 10px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    transition: all 0.2s ease;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    outline: none;
}

.donut-center-btn:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
    transform: scale(1.04);
}

.donut-center-btn-stacked {
    flex-direction: column;
    justify-content: center;
    padding: 5px 12px;
    border-radius: 16px;
    line-height: 1.2;
}

.donut-center-btn-stacked .btn-top-label {
    font-size: 0.62rem;
    opacity: 0.75;
    
    letter-spacing: 0.5px;
}

.donut-center-btn-stacked .btn-main-label {
    font-size: 0.75rem;
    font-weight: 600;
}

.channel-row {
    cursor: pointer;
    transition: background-color 0.2s;
}

.channel-row:hover {
    background-color: rgba(255, 255, 255, 0.05) !important;
}

.channel-row .chevron-hint {
    opacity: 0;
    transform: translateX(-4px);
    transition: all 0.2s ease;
    color: var(--accent-color);
}

.channel-row:hover .chevron-hint {
    opacity: 1;
    transform: translateX(0);
}

