/* TEMPLATE MODIFICA */
:root {
    --verde1: #7FCD99;
    /* Light Green Background */
    --verde2: #004D40;
    /* Dark Green Elements */
    --grigio1: #f7f7f7;
    --bianco: #FFFFFF;
    --verde-btn: #005F63;
}

body {
    background-color: var(--grigio1);
}

.bgGreen {
    background-color: var(--verde1);
    min-height: 100vh;
}

#mainContent .card {
    border-radius: 1rem;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.1);
    border: none;
}

#mainContent {
    color: var(--verde2);
}

/* Custom Button Styles */
.btn-custom-dark {
    background-color: var(--verde-btn);
    color: white;
    border: 1px solid var(--verde-btn);
    font-weight: 500;
}

.btn-custom-dark:hover {
    background-color: #00464a;
    color: white;
}

.btn-custom-outline {
    background-color: white;
    color: var(--verde-btn);
    border: 1px solid var(--verde-btn);
    font-weight: 500;
}

.btn-custom-outline:hover {
    background-color: #f0f0f0;
    color: var(--verde-btn);
}

/* Header Styles */
#topBar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--verde1);
    /* Match bg */
}

.top-search-bar {
    background-color: white;
    border-radius: 20px;
    padding: 0.5rem 1.5rem;
    width: 400px;
    border: none;
    text-align: center;
    outline: none;
}

.top-icons {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: var(--verde2);
    font-size: 1.5rem;
}

.profile-icon {
    width: 40px;
    height: 40px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--verde2);
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
}

/* Sidebar Styles */
#mainMenu {
    background-color: white;
    border-right: 1px solid #eee;
}

/* Home Page Specifics */
.home-action-card {
    text-align: center;
    padding: 2rem;
}

.home-action-card h5 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--verde2);
    font-weight: bold;
}

.home-action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.home-action-buttons .btn {
    min-width: 120px;
    height: 70px;
    background-color: var(--verde-btn) !important;
    color: white !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    line-height: 1.2 !important;
    padding: 0 !important;
    margin: 0;
}

.doc-card-title {
    font-weight: bold;
    color: var(--verde2);
    margin-bottom: 1rem;
}

.doc-card-info li {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.doc-card-info strong {
    color: var(--verde2);
}

/* Overwrite existing button styles in mainContent if needed */
#mainContent .btn-primary {
    background-color: var(--verde-btn);
    border-color: var(--verde-btn);
}

#mainContent .btn-outline-primary {
    color: var(--verde-btn);
    border-color: var(--verde-btn);
}


/*RISOLVE IL PROBLEMA DELLO SCROLL ORIZZONTALE NELLA SCHERMATE DI EDIT E INSERIMENTO*/
.gc-container>.row {
    margin: 0px;
}

a.nav-link.active {
    background-color: #EEE;
}

/* PROFILI */
h3.profili,
span.azioni_base {
    cursor: pointer;
}

#menuLogo {
    text-align: center;
}

#menuLogo img {
    width: 80px;
    display: block;
    margin: 0 auto
}

nav.navbar {
    margin-bottom: 20px;
    padding: 10px;
}

.navbar-brand {
    padding: 0px;
    margin: 0px;
}

#userImage {
    border-radius: 50px;
    height: 40px;
}

/*nascondo il pulsante per il savataggio ajax*/
/*#form-button-save{ display: none;  }*/

/** MODAL */
#modal_panel {
    display: none;
    position: fixed;
    z-index: 100;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.4);
}

#modal_element {
    display: inline-block;
    z-index: 1000;
    padding: 40px 20px 20px;
    position: relative;
    max-width: 90vw;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

#modal_element [rel-data=close-modal] {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2em;
    padding: 0px;
    color: #333;
    opacity: 0.7;
    transition: opacity 0.2s;
    border: none;
    background: transparent;
    line-height: 1;
}

#modal_element [rel-data=close-modal]:hover {
    opacity: 1;
    color: #000;
}

/** TOAST MESSAGE */
.toast-message {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #28a745; /* Fallback */
    background-color: var(--verde-btn); /* Brand Green */
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast-message.show {
    opacity: 1;
}

.toast-message i {
    font-size: 1.2em;
}

.toast-message.toast-error {
    background-color: #dc3545;
}

/** BOOTSTRAP ALERTS OVERRIDE */
.alert-success {
    background-color: var(--verde1) !important;
    color: var(--verde2) !important;
    border-color: rgba(0, 77, 64, 0.1) !important;
    font-weight: 500;
}

/** MULTI_ELEMENT */
#modal_content iframe {
    width: 70vw;
    height: 90vh
}

/** EDITOR */
textarea.texteditor,
textarea.mini-texteditor {
    display: none;
}

/** FANCYBOX IFRAME x FILE UPLOAD */
.fancybox-slide--iframe .fancybox-content {
    max-width: 80%;
    max-height: 80%;
    margin: 0;
}

.gc-container .table-label {
    font-size: 1.5em !important;
}

/** CAMPI IN SOLA LETTURA PIÙ CENTRATI VERTICALMENTE */
.readonly_label {
    margin-top: 8px;
}

/** CUSTOM FIELDS _CORE */
/** fieldSelectMultiCheckboxAjax */
.selectMultiAjaxResult {
    max-height: 200px;
    overflow-y: scroll;
    overflow-x: hidden;
    margin-top: 5px;
}

/** fieldSelectOreMinuti **/
.selectOreMinuti {
    display: inline;
    width: auto;
}

/* Sidebar Layout */
@media (min-width: 992px) {
    #mainContainer {
        display: flex;
        flex-direction: row;
        min-height: 100vh;
    }

    #mainMenu {
        width: 100px;
        /* Default collapsed width */
        min-width: 100px;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        /* Ensure items start from top */
        margin-bottom: 0px;
        padding-top: 2rem;
        background-color: #fff;
        border-right: none;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
        transition: all 0.3s ease;
        /* Smooth transition */
    }

    /* Ensure no flex-grow on container */
    #mainMenu .navbar-collapse {
        flex-grow: 0;
        width: 100%;
    }

    /* Expanded State */
    #mainMenu.menu-expanded {
        width: 250px;
        min-width: 250px;
    }

    #mainContent {
        flex: 1;
        display: flex;
        flex-direction: column;
        background-color: var(--grigio1);
        overflow-x: hidden;
    }

    /* Sidebar Items */
    #mainMenu .navbar-nav {
        width: 100%;
        padding-left: 0;
        margin-top: 2rem;
        /* Reduced margin */
        display: none;
        /* Hidden by default */
        flex-direction: column;
    }

    /* Show items when expanded */
    #mainMenu.menu-expanded .navbar-nav {
        display: flex !important;
        opacity: 1;
        transition: opacity 0.3s ease;
    }

    #mainMenu .nav-item {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    #mainMenu .nav-link {
        color: var(--verde2);
        /* Green theme color */
        font-size: 1.2rem;
        padding: 0.8rem 2rem;
        /* Add padding for click area */
        text-align: left;
        font-weight: 500;
    }

    #mainMenu .nav-link:hover,
    #mainMenu .nav-link.active {
        color: var(--verde2);
        font-weight: bold;
        background-color: rgba(0, 77, 64, 0.05);
        /* Subtle hover effect */
    }

    /* Logo */
    #menuLogo {
        margin-bottom: 0.5rem;
        transition: transform 0.3s ease;
    }

    #menuLogo:hover {
        transform: scale(1.05);
    }

    #sidebarToggle {
        padding: 5px;
        line-height: 1;
        color: var(--verde2);
        opacity: 0.6;
        transition: all 0.2s ease;
        margin-bottom: 1rem;
        border: none;
        background: transparent;
        border-radius: 50%;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #sidebarToggle:hover {
        opacity: 1;
        background-color: rgba(0, 77, 64, 0.05);
        color: var(--verde2);
    }

    #sidebarToggle i {
        font-size: 1.2rem;
    }

    #menuLogo img {
        width: 80px;
        height: 80px;
        border-radius: 50%;
        object-fit: cover;
    }
}

/* Header Styles */
#topBar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: var(--verde1);
    /* Match bg */
    width: 100%;
}

/* Home Page Specifics */
.home-page-container {
    background-color: var(--verde1);
    flex: 1;
    /* Fill remaining space */
    padding: 0 2rem 2rem 2rem;
}

/* Override .bgGreen to simply be the container class */
.bgGreen {
    background-color: var(--verde1);
    height: 100%;
}

/* Cards adjustments */
.home-action-card {
    background-color: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Typography */
h5 {
    color: var(--verde2);
    font-weight: bold;
}

/* Fix for Search Input in TopBar */
.top-search-bar {
    background-color: white;
    border-radius: 25px;
    padding: 0.7rem 2rem;
    width: 500px;
    border: none;
    text-align: center;
    outline: none;
    font-size: 1rem;
    color: var(--verde2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Fix Icons */
.top-icons i {
    cursor: pointer;
    transition: transform 0.2s;
}

.top-icons i:hover {
    transform: scale(1.1);
}

/* Hide default mobile menu toggler on desktop if visible */
.navbar-toggler {
    display: none;
}

@media (max-width: 991px) {
    .navbar-toggler {
        display: block;
    }
}