/**
 * Segreteria Informatizzata - Custom Styles
 * Bootstrap 5.3 Dark Theme Customization
 */

:root {
    --si-primary: #0d6efd;
    --si-success: #198754;
    --si-warning: #ffc107;
    --si-danger: #dc3545;
    --si-info: #0dcaf0;
}

/* Force dark mode */
[data-bs-theme="dark"] {
    --bs-body-bg: #1a1d21;
    --bs-body-bg-rgb: 26, 29, 33;
    --bs-tertiary-bg: #212529;
    --bs-tertiary-bg-rgb: 33, 37, 41;
}

/* Body */
body {
    min-height: 100vh;
}

/* Login Page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1d21 0%, #2d3238 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.3);
}

.login-logo {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--si-primary);
    border-radius: 1rem;
    margin: 0 auto 1.5rem;
}

.login-logo i {
    font-size: 2.5rem;
    color: white;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: #212529;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1000;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand h5 {
    margin: 0;
    font-weight: 600;
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-nav .nav-link {
    padding: 0.75rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s ease;
}

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

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

.sidebar-nav .nav-link i {
    width: 1.25rem;
    text-align: center;
}

/* Sidebar submenu dropdown */
.nav-item-dropdown .nav-submenu {
    display: none;
    background: rgba(0, 0, 0, 0.15);
}
.nav-item-dropdown .nav-submenu.show {
    display: block;
}
.nav-item-dropdown .nav-submenu .nav-link {
    padding: 0.5rem 1.5rem 0.5rem 2rem;
    font-size: 0.875rem;
}
.nav-item-dropdown > .nav-link .bi-chevron-down {
    transition: transform 0.2s ease;
    font-size: 0.7rem;
}
.nav-item-dropdown > .nav-link[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

/* Main Content */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    padding: 0;
}

.main-header {
    background: #212529;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.main-body {
    padding: 1.5rem;
}

/* Cards */
.card {
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.2);
}

.card-header {
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Tables */
.table {
    --bs-table-bg: transparent;
}

.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.6);
    border-bottom-width: 1px;
}

.table td {
    vertical-align: middle;
}

/* Stats Cards */
.stat-card {
    border-left: 4px solid var(--si-primary);
}

.stat-card.success {
    border-left-color: var(--si-success);
}

.stat-card.warning {
    border-left-color: var(--si-warning);
}

.stat-card.danger {
    border-left-color: var(--si-danger);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Badges */
.badge-status {
    font-weight: 500;
    padding: 0.4em 0.8em;
}

/* Forms */
.form-control:focus,
.form-select:focus {
    border-color: var(--si-primary);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Buttons */
.btn {
    font-weight: 500;
}

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

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }
}

/* Utilities */
.cursor-pointer {
    cursor: pointer;
}

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

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
}

/* Empty State */
.empty-state {
    padding: 3rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Action Buttons in Tables */
.btn-action {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Event Status Indicator */
.event-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.event-status.active {
    background: var(--si-success);
    box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.3);
}

.event-status.inactive {
    background: var(--si-danger);
}
