/* Passbot - Custom Styles */

:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 0px;
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --brand-orange: #ff8e40;
    --brand-orange-hover: #e0930d;
    --brand-orange-active: #cc8500;
}

/* Sidebar */
#sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    min-height: 100vh;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    border-right: 3px solid var(--brand-orange);
}

#sidebar.collapsed {
    margin-left: calc(var(--sidebar-width) * -1);
}

#sidebar .nav-link {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
    transition: all 0.2s ease;
}

#sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

#sidebar .nav-link.active {
    background-color: var(--primary-color);
}

/* Sidebar collapsible sections */
.sidebar-section {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 0.25rem;
    padding-top: 0.25rem;
}

.sidebar-section-toggle {
    text-decoration: none !important;
    cursor: pointer;
    user-select: none;
    padding: 0.4rem 0.5rem;
    border-radius: 0.375rem;
    display: flex;
    color: #FF8E40 !important;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.sidebar-section-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-section-toggle .sidebar-chevron {
    font-size: 0.6rem;
    transition: transform 0.2s ease;
}

.sidebar-section-toggle[aria-expanded="false"] .sidebar-chevron {
    transform: rotate(-90deg);
}

.sidebar-section-toggle[aria-expanded="true"] .sidebar-chevron {
    transform: rotate(0deg);
}

/* Voci di secondo livello con sottomenu: arancione più chiaro */
.sidebar-section-toggle.sidebar-subtoggle {
    color: #ffc08a !important;
    font-weight: 500;
    letter-spacing: normal;
}

/* Cuore pulsante per evidenziare la voce "Iscrizione" */
@keyframes heart-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.35); }
}

.heart-pulse {
    display: inline-block;
    animation: heart-pulse 1s ease-in-out infinite;
}

/* Main Content */
#content {
    min-height: 100vh;
    min-width: 0;
    transition: all 0.3s ease;
    background-color: #f1f5f9;
}

#content.expanded {
    margin-left: 0;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 1.25rem;
}

/* Tables */
.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: var(--secondary-color);
    border-bottom-width: 1px;
}

.table td {
    vertical-align: middle;
}

/* Buttons */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
}

.btn-group-sm .btn {
    padding: 0.25rem 0.5rem;
}

/* Forms */
.form-control, .form-select {
    border-radius: 0.375rem;
    border-color: #e2e8f0;
}

.form-check-input {
    border-color: #94a3b8;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: #374151;
    margin-bottom: 0.375rem;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.5rem;
}

/* Progress bars */
.progress {
    border-radius: 1rem;
    overflow: hidden;
}

/* Accordion */
.accordion-button:not(.collapsed) {
    background-color: rgba(37, 99, 235, 0.05);
    color: var(--primary-color);
}

.accordion-button:focus {
    box-shadow: none;
    border-color: rgba(0, 0, 0, 0.125);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Responsive */
@media (max-width: 768px) {
    #sidebar {
        position: fixed;
        z-index: 1000;
        margin-left: calc(var(--sidebar-width) * -1);
    }

    #sidebar.show {
        margin-left: 0;
    }

    #content {
        width: 100%;
    }
}

/* Print styles */
@media print {
    #sidebar,
    .navbar,
    .btn,
    .alert {
        display: none !important;
    }

    #content {
        margin: 0;
        padding: 0;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

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

/* Loading spinner */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Status badges */
.badge-stato-attivo {
    background-color: #10b981;
}

.badge-stato-annullato {
    background-color: #ef4444;
}

.badge-stato-sospeso {
    background-color: #f59e0b;
}

/* QR Code container */
.qr-container {
    display: inline-block;
    padding: 1rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Event card hover effect - disabled */

/* Pass type color indicator */
.pass-type-indicator {
    width: 4px;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    border-radius: 0.5rem 0 0 0.5rem;
}

/* Stats card hover */
.card.bg-primary:hover,
.card.bg-success:hover,
.card.bg-info:hover,
.card.bg-warning:hover,
.card.bg-danger:hover {
    filter: brightness(1.05);
}

/* Form input groups */
.input-group-text {
    background-color: #f8fafc;
    border-color: #e2e8f0;
}

/* Modal improvements */
.modal-content {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-header {
    border-bottom-color: #f1f5f9;
}

.modal-footer {
    border-top-color: #f1f5f9;
}

/* Dropdown improvements */
.dropdown-menu {
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    margin: 0.125rem 0.25rem;
    width: auto;
}

.dropdown-item:hover {
    background-color: #f1f5f9;
}

/* Impersonation banner */
.alert-warning.rounded-0 {
    border-left: 4px solid #f59e0b;
}

/* Helper classes */
.cursor-pointer {
    cursor: pointer;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Color picker full width */
input[type="color"].form-control-color {
    height: 38px;
}

/* Auth pages - brand orange theme */
body.bg-light .btn-primary {
    background-color: var(--brand-orange);
    border-color: var(--brand-orange);
}

body.bg-light .btn-primary:hover {
    background-color: var(--brand-orange-hover);
    border-color: var(--brand-orange-hover);
}

body.bg-light .btn-primary:active,
body.bg-light .btn-primary:focus {
    background-color: var(--brand-orange-active);
    border-color: var(--brand-orange-active);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.3);
}

body.bg-light .nav-pills .nav-link.active {
    background-color: var(--brand-orange);
    border-color: var(--brand-orange);
}

body.bg-light .nav-pills .nav-link:not(.active) {
    color: var(--brand-orange);
}

body.bg-light .form-control:focus,
body.bg-light .form-select:focus {
    border-color: var(--brand-orange);
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.15);
}

body.bg-light a:not(.btn):not(.nav-link) {
    color: var(--brand-orange-hover);
}

body.bg-light a:not(.btn):not(.nav-link):hover {
    color: var(--brand-orange-active);
}

/* Descrizione prodotto: HTML dall'editor, può contenere immagini inline */
.prodotto-descrizione img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.prodotto-descrizione p:last-child {
    margin-bottom: 0;
}
