﻿/* ===== ADMIN PANEL CSS ===== */
/* stili per il sotto menu */

.sidebar-nav li.has-submenu > a {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .sidebar-nav li.has-submenu > a .submenu-arrow {
        transition: transform 0.3s ease;
    }

.sidebar-nav li.has-submenu.open > a .submenu-arrow {
    transform: rotate(90deg);
}

.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: rgba(0, 0, 0, 0.2);
}

.sidebar-nav li.has-submenu.open .submenu {
    max-height: 500px;
}

.submenu li a {
    padding: 12px 20px 12px 50px;
    font-size: 14px;
}

    .submenu li a:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }

    .submenu li a.active {
        background-color: rgba(255, 255, 255, 0.15);
        border-left: 3px solid #fff;
    }

/* Variables */
:root {
    --sidebar-width: 250px;
    --header-height: 60px;
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
}

/* Base Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #ecf0f1;
    margin: 0;
    padding: 0;
}

/* ===== HEADER ===== */
.admin-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    height: var(--header-height);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

    .admin-header .navbar-brand {
        color: white !important;
        font-weight: bold;
        font-size: 1.5rem;
    }

    .admin-header .navbar-nav .nav-link {
        color: rgba(255,255,255,0.9) !important;
        transition: color 0.3s ease;
    }

        .admin-header .navbar-nav .nav-link:hover {
            color: white !important;
        }

/* ===== SIDEBAR ===== */
.admin-sidebar {
    background: var(--primary-color);
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    position: fixed;
    top: var(--header-height);
    left: 0;
    overflow-y: auto;
    transition: transform 0.3s ease;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

    .admin-sidebar.collapsed {
        transform: translateX(-100%);
    }

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .sidebar-nav li {
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .sidebar-nav a {
        display: block;
        padding: 15px 20px;
        color: rgba(255,255,255,0.9);
        text-decoration: none;
        transition: all 0.3s ease;
    }

        .sidebar-nav a:hover,
        .sidebar-nav a.active {
            background-color: var(--accent-color);
            color: white;
            padding-left: 25px;
        }

    .sidebar-nav i {
        width: 20px;
        margin-right: 10px;
        text-align: center;
    }

/* ===== MAIN CONTENT ===== */
.admin-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    padding: 20px;
    min-height: calc(100vh - var(--header-height));
    transition: margin-left 0.3s ease;
}

    .admin-content.expanded {
        margin-left: 0;
    }

/* ===== CARDS ===== */
.admin-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.admin-card-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 1px solid #dee2e6;
    padding: 15px 20px;
    font-weight: 600;
    color: var(--primary-color);
}

.admin-card-body {
    padding: 20px;
}

/* ===== STATS CARDS ===== */
.stats-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-left: 4px solid var(--accent-color);
    transition: transform 0.2s ease;
}

    .stats-card:hover {
        transform: translateY(-2px);
    }

    .stats-card.success {
        border-left-color: var(--success-color);
    }

    .stats-card.warning {
        border-left-color: var(--warning-color);
    }

    .stats-card.danger {
        border-left-color: var(--danger-color);
    }

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-content {
        margin-left: 0;
        padding: 10px;
    }

    .admin-sidebar.show {
        transform: translateX(0);
    }
}

/* ===== MOBILE TOGGLE BUTTON ===== */
.sidebar-toggle {
    display: none;
}

@media (max-width: 768px) {
    .sidebar-toggle {
        display: inline-block;
    }
}

/* ===== ANIMATIONS ===== */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== ADDITIONAL UTILITY CLASSES ===== */
.admin-btn {
    border-radius: 6px;
    font-weight: 500;
    padding: 8px 16px;
    transition: all 0.3s ease;
}

    .admin-btn:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    }

.admin-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

    .admin-table th {
        background-color: #f8f9fa;
        border-bottom: 2px solid #dee2e6;
        font-weight: 600;
        color: var(--primary-color);
    }

.admin-form-group {
    margin-bottom: 1.5rem;
}

.admin-form-control {
    border-radius: 6px;
    border: 1px solid #ddd;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

    .admin-form-control:focus {
        border-color: var(--accent-color);
        box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
    }

/* ===== BREADCRUMB ===== */
.admin-breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 20px;
}

    .admin-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
        content: "›";
        font-size: 1.2em;
        color: #6c757d;
    }

/* ===== NOTIFICATION BADGES ===== */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===== LOGIN FORM STYLES ===== */
.login-container {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    animation: slideUp 0.5s ease-out;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-icon {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 15px;
}

.login-header h2 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 600;
}

.login-header p {
    color: #6c757d;
    margin-bottom: 0;
}

.login-form {
    width: 100%;
}

    .login-form .form-group {
        margin-bottom: 20px;
    }

    .login-form label {
        display: block;
        margin-bottom: 8px;
        color: var(--primary-color);
        font-weight: 500;
    }

        .login-form label i {
            margin-right: 8px;
            width: 16px;
            text-align: center;
        }

    .login-form .form-control {
        width: 100%;
        padding: 12px 15px;
        border: 2px solid #e9ecef;
        border-radius: 8px;
        font-size: 16px;
        transition: border-color 0.3s ease;
        box-sizing: border-box;
    }

        .login-form .form-control:focus {
            outline: none;
            border-color: var(--accent-color);
            box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
        }
.account-form {
    width: 100%;
}

    .account-form .form-group {
        margin-bottom: 10px;
    }

    .account-form label {
        display: block;
        margin-bottom: 4px;
        color: var(--primary-color);
        font-weight: 500;
    }

        .account-form label i {
            margin-right: 4px;
            width: 16px;
            text-align: center;
        }

    .account-form .form-control {
        width: 100%;
        padding: 12px 15px;
        border: 2px solid #e9ecef;
        border-radius: 8px;
        font-size: 16px;
        transition: border-color 0.3s ease;
        box-sizing: border-box;
    }

        .account-form .form-control:focus {
            outline: none;
            border-color: var(--accent-color);
            box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
        }


.password-input {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 5px;
}

    .password-toggle:hover {
        color: var(--primary-color);
    }

.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
}

    .checkbox-container input {
        margin-right: 10px;
    }

.login-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--accent-color), #2980b9);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

    .login-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
    }

.login-links {
    text-align: center;
    margin-top: 20px;
}

    .login-links a {
        color: var(--accent-color);
        text-decoration: none;
        font-size: 14px;
    }

        .login-links a:hover {
            text-decoration: underline;
        }

.login-footer {
    margin-top: 30px;
    text-align: center;
}

    .login-footer p {
        color: rgba(255,255,255,0.8);
        font-size: 14px;
        margin: 0;
    }

/* Login animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive login */
@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
    }

    .login-icon {
        font-size: 2.5rem;
    }
}
/* correct positioning for mobile */
/* Aumenta lo z-index della sidebar per essere sopra la tabella */
.admin-sidebar {
    z-index: 1050 !important;
    position: fixed;
}

/* Assicura che il contenuto principale sia sotto la sidebar */
.admin-content {
    position: relative;
    z-index: 1;
}

/* === FIX PER TABELLA RESPONSIVE === */

/* Wrapper responsive per la tabella */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

/* Rimuovi la classe table-responsive dalla tabella e mettila su un wrapper */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    width: 100%;
}

/* Tabella su mobile */
@media (max-width: 768px) {
    /* Quando la sidebar è aperta, aggiungi overlay al contenuto */
    .admin-sidebar.show ~ .admin-content::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1040;
    }

    /* Forza la tabella a essere scrollabile */
    .table-wrapper {
        max-width: 100%;
    }