/* Custom CSS for Condominium App */

:root {
    --primary-color: #87CEEB; /* Blu chiaro */
    --primary-dark: #5BA6CC;
    --sidebar-width: 250px;
}

/* Light Theme */
[data-bs-theme="light"] {
    --bs-primary: #87CEEB;
    --bs-primary-rgb: 135, 206, 235;
}

/* Dark Theme */
[data-bs-theme="dark"] {
    --bs-primary: #5BA6CC;
    --bs-primary-rgb: 91, 166, 204;
    --bs-body-bg: #212529;
    --bs-body-color: #dee2e6;
}

/* Body */
body {
    transition: background-color 0.3s, color 0.3s;
}

/* Sidebar */
#sidebar-wrapper {
    min-height: 100vh;
    height: 100vh;
    width: var(--sidebar-width);
    transition: all 0.3s;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
}

#sidebar-wrapper .sidebar-heading {
    padding: 1.5rem;
}

#sidebar-wrapper .list-group-item {
    border: none !important;
    padding: 1rem 1.5rem;
    transition: background-color 0.2s;
}

/* Light Theme - Menu items hover effect */
[data-bs-theme="light"] #sidebar-wrapper .list-group-item:hover {
    background-color: rgba(0, 0, 0, 0.15) !important;
}

/* Dark Theme - Menu items hover effect */
[data-bs-theme="dark"] #sidebar-wrapper .list-group-item:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Submenu (collapsed items) - mantiene lo stesso colore del menu principale */
#sidebar-wrapper .collapse .list-group-item {
    background-color: inherit !important;
}

/* Light Theme - Submenu hover */
[data-bs-theme="light"] #sidebar-wrapper .collapse .list-group-item:hover {
    background-color: rgba(0, 0, 0, 0.15) !important;
}

/* Dark Theme - Submenu hover */
[data-bs-theme="dark"] #sidebar-wrapper .collapse .list-group-item:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Page Content */
#page-content-wrapper {
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s;
}

/* Sidebar Toggle */
#wrapper.toggled #sidebar-wrapper {
    margin-left: calc(var(--sidebar-width) * -1);
}

#wrapper.toggled #page-content-wrapper {
    margin-left: 0;
}

/* Cards */
.card {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #000;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
}

/* Badge Colors */
.badge {
    font-weight: 500;
}

/* Status Badges */
.status-aperto {
    background-color: #0dcaf0;
}

.status-in_lavorazione {
    background-color: #ffc107;
}

.status-assegnato {
    background-color: #0d6efd;
}

.status-in_attesa {
    background-color: #6c757d;
    color: #ffffff;
}

.status-risolto {
    background-color: #198754;
}

.status-chiuso {
    background-color: #6c757d;
}

.status-cancellato {
    background-color: #dc3545;
    color: #ffffff;
    text-decoration: line-through;
}

/* Priority Badges */
.priority-bassa {
    background-color: #6c757d;
}

.priority-media {
    background-color: #0dcaf0;
}

.priority-alta {
    background-color: #ffc107;
}

.priority-urgente {
    background-color: #dc3545;
}

/* Login Page */
.login-container {
    background: white;
    border-radius: 15px;
    padding: 2.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .login-container {
    background: #2b3035;
}

.logo-login {
    max-width: 150px;
    margin-bottom: 1.5rem;
}

.logo-sidebar {
    filter: brightness(0) invert(1);
}

/* Tables */
.table {
    background: transparent;
}

/* Communication Card */
.communication-card {
    border-left: 4px solid var(--primary-color);
}

/* Ticket Card */
.ticket-card {
    border-left: 4px solid var(--primary-color);
}

/* Dark Mode Toggle */
#darkModeToggle {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
    #sidebar-wrapper {
        margin-left: calc(var(--sidebar-width) * -1);
    }
    
    #page-content-wrapper {
        margin-left: 0;
    }
    
    #wrapper.toggled #sidebar-wrapper {
        margin-left: 0;
    }
}

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

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

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

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

[data-bs-theme="dark"] ::-webkit-scrollbar-track {
    background: #2b3035;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Alert Improvements */
.alert {
    border-radius: 10px;
    border: none;
}

/* Form Improvements */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(135, 206, 235, 0.25);
}

/* Stats Cards */
.stat-card {
    text-align: center;
    padding: 1.5rem;
    border-radius: 12px;
}

.stat-card .stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-card .stat-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Messaggi Broadcast */
.broadcast-message {
    margin-bottom: 0;
    font-size: 0.95rem;
}

.broadcast-info {
    background-color: #cfe2ff;
    color: #084298;
    border: 1px solid #b6d4fe;
}

.broadcast-warning {
    background-color: #fff3cd;
    color: #664d03;
    border: 1px solid #ffecb5;
}

.broadcast-danger {
    background-color: #f8d7da;
    color: #842029;
    border: 1px solid #f5c2c7;
}

.broadcast-success {
    background-color: #d1e7dd;
    color: #0f5132;
    border: 1px solid #badbcc;
}

/* Dark mode per messaggi broadcast */
[data-bs-theme="dark"] .broadcast-info {
    background-color: #031633;
    color: #6ea8fe;
    border-color: #084298;
}

[data-bs-theme="dark"] .broadcast-warning {
    background-color: #332701;
    color: #ffda6a;
    border-color: #664d03;
}

[data-bs-theme="dark"] .broadcast-danger {
    background-color: #2c0b0e;
    color: #ea868f;
    border-color: #842029;
}

[data-bs-theme="dark"] .broadcast-success {
    background-color: #051b11;
    color: #75b798;
    border-color: #0f5132;
}

/* Pulsante Dark Mode su pagina di login */
.login-container #darkModeToggle {
    border-radius: 25px;
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 2px solid #6c757d;
}

.login-container #darkModeToggle:hover {
    background-color: #6c757d;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] .login-container #darkModeToggle {
    border-color: #adb5bd;
    color: #adb5bd;
}

[data-bs-theme="dark"] .login-container #darkModeToggle:hover {
    background-color: #adb5bd;
    color: #212529;
}

/* Menu Avanzato con Sottomenu */
.menu-section {
    position: relative;
}

.menu-toggle {
    cursor: pointer;
    position: relative;
}

.menu-toggle .bi-chevron-down {
    transition: transform 0.3s ease;
}

.menu-toggle[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

.menu-toggle:not(.collapsed) .bi-chevron-down {
    transform: rotate(180deg);
}

/* Sottomenu items con animazione */
.collapse {
    transition: height 0.3s ease;
}

.collapse .list-group-item {
    background-color: rgba(0, 0, 0, 0.2) !important;
    border-left: 3px solid var(--primary-color) !important;
    font-size: 0.9rem;
}

.collapse .list-group-item:hover {
    background-color: rgba(255, 255, 255, 0.15) !important;
    padding-left: 3.5rem !important;
    transition: padding-left 0.2s ease;
}

/* Dark mode per sottomenu */
[data-bs-theme="dark"] .collapse .list-group-item {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-left-color: var(--primary-dark) !important;
}

[data-bs-theme="dark"] .collapse .list-group-item:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Pulsante Test Email */
.test-email-btn {
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.test-email-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.test-email-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Badge di stato configurazione */
.config-status-badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
    border-radius: 12px;
}

/* Storico Notifiche Email */
.timeline .small {
    font-size: 0.875rem;
}

/* Dark mode per storico notifiche */
[data-bs-theme="dark"] .bg-success.bg-opacity-10 {
    background-color: rgba(25, 135, 84, 0.2) !important;
    border-color: rgba(25, 135, 84, 0.3) !important;
}

[data-bs-theme="dark"] .timeline .text-muted {
    color: #adb5bd !important;
}

[data-bs-theme="dark"] .timeline .bg-light {
    background-color: #343a40 !important;
    color: #dee2e6 !important;
}

[data-bs-theme="dark"] .timeline .border-bottom {
    border-color: #495057 !important;
}

[data-bs-theme="dark"] .alert-danger.alert-sm {
    background-color: rgba(220, 53, 69, 0.2) !important;
    color: #f8d7da !important;
    border-color: rgba(220, 53, 69, 0.3) !important;
}

[data-bs-theme="dark"] .btn-outline-secondary {
    color: #adb5bd;
    border-color: #6c757d;
}

[data-bs-theme="dark"] .btn-outline-secondary:hover {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

/* Notifica email cliccabile */
.notifica-item {
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 8px;
}

.notifica-item:hover {
    background-color: rgba(135, 206, 235, 0.1);
    transform: translateX(5px);
}

[data-bs-theme="dark"] .notifica-item:hover {
    background-color: rgba(91, 166, 204, 0.2);
}

/* Stili per eventi timeline */
.evento-item {
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 8px;
}

.evento-cliccabile:hover {
    background-color: rgba(135, 206, 235, 0.1);
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

[data-bs-theme="dark"] .evento-cliccabile:hover {
    background-color: rgba(91, 166, 204, 0.2);
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.1);
}

