/* ========================================================================
   IMPORTS & BASE TYPOGRAPHY
   ======================================================================== */

/* Import Google Fonts */
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&family=Unna:wght@400;700&display=swap");

body,
label,
input,
button,
textarea {
    font-family: "Roboto", Arial, sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "Unna", serif;
    color: #b0854d;
    font-weight: 400;
    margin: 0;
}

body {
    margin-bottom: 100px;
    text-align: center;
    color: #868686;
    padding: 50px 36px;
    border-top: 3px solid #b0854d;
    margin: 0;
    font-size: 16px;
}

h1 {
    font-size: 40px;
}

h1+p {
    margin-top: 0;
    margin-bottom: 60px;
}

.logo-container {
    text-align: center;
    margin-bottom: 50px;
}

.logo-container img,
.info-header-flex img {
    max-width: 65px;
    height: auto;
}

.sublogo {
    font-family: "Unna", serif;
    font-size: 40px;
    color: #b0854d;
    margin-top: 10px;
    display: block;
}

.logo-container+h1 {
    font-size: 26px;
    margin-bottom: 10px;
    text-wrap: balance;
}

/* Checkbox personalizzate gold */
.form-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #b0854d;
    border-radius: 2px;
    background: #fff;
    outline: none;
    cursor: pointer;
    vertical-align: middle;
    position: relative;
    transition: background 0.2s, border-color 0.2s;
    padding: 0;
    margin: 0;
}

.form-checkbox input[type="checkbox"]:checked {
    background: #b0854d;
    border-color: #b0854d;
}

.form-checkbox input[type="checkbox"]:checked::after {
    content: "";
    display: block;
    position: absolute;
    left: 4px;
    top: -1px;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.form-checkbox label {
    margin-left: 6px;
    cursor: pointer;
    user-select: none;
    flex: 1;
}

.privacy-link {
    text-align: left;
}

.privacy-link a {
    color: #b0854d;
}

/* ========================================================================
   LOGO & SPACING (INFO.PHP)
   ======================================================================== */

/* Rimuove margin e padding per container senza spazi */
.no-margin-padding {
    margin: 0 !important;
    padding: 0 !important;
}

/* Margin bottom 10px */
.mb-10 {
    margin-bottom: 10px !important;
}

/* Clienti list senza margini aggiuntivi */
.clienti-list-no-margin {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Accordion header title */
.accordion-header-title {
    font-weight: bold;
    font-size: 16px;
    color: #868686;
}

/* Accordion arrow */
.arrow {
    font-size: 20px;
    color: #b0854d;
    margin-left: 12px;
    transition: transform 0.2s;
}

/* Accordion content per clienti */
.clienti-accordion-content {
    padding: 0 20px 14px 20px;
    color: #868686;
    justify-content: space-between;
    gap: 10px;
}

.clienti-accordion-detail {
    color: #868686;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 14px;
}

.clienti-accordion-detail > div {
    display: flex;
    gap: 5px;
    align-items: flex-start;
    flex-direction: column;
}

.clienti-accordion-detail.actions {
    gap: 0;
    margin-left: -7px;
    margin-bottom: 0;
    flex-direction: row;
    align-items: center;
}

select.stato-nominativo-select {
    width: 100%;
    height: 35px;
    margin-left: 7px;
    padding: 0;
    border-radius: 5px;
}

/* Client datetime row - shown above contact info when enabled */

.client-datetime-row input.appt-datetime-input-agenda {
    width: 100%;
    height: 35px;
    padding: 3px 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    font-family: "Roboto", Arial, sans-serif;
    box-sizing: border-box;
    margin: 0;
    background-color: #fff;
    line-height: normal;
}

.client-datetime-row input.appt-datetime-input-agenda:focus {
    outline: none;
    border-color: #b0854d;
}

/* Client info grid layout */
.client-info-notes {
    font-style: italic;
}

.client-info-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    flex-direction: column;
}

.client-info-item,
.client-info-notes {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    font-size: 14px;
    color: #868686;
}

/* Client actions grid layout - now below contact info */
.client-actions-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.client-actions-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.client-actions-buttons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    text-decoration: none;
    line-height: 0;
}

.client-actions-buttons a img {
    display: block;
}

.client-actions-controls {
    display: flex;
    width: 100%;
}

.client-actions-controls select.stato-nominativo-select {
    width: 100%;
    height: 35px;
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    font-family: "Roboto", Arial, sans-serif;
    box-sizing: border-box;
    margin: 0;
    background-color: #fff;
    line-height: normal;
}

.client-actions-controls select.stato-nominativo-select:focus {
    outline: none;
    border-color: #b0854d;
}

form,
#date-list {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ========================================================================
   UTILITY CLASSES
   ======================================================================== */

/* Text alignment */
.text-left {
    text-align: left !important;
}

/* Margin utilities */
.btn-margin-bottom {
    margin-bottom: 10px;
}

/* Inline form utility */
.form-inline {
    display: inline;
}

/* Error message */
.error {
    color: red;
}

/* ========================================================================
   BUTTONS & LINKS
   ======================================================================== */

/* Base button */
.btn,
button.btn,
a.btn {
    font-size: 16px;
    font-weight: 400;
    color: #868686;
    background: #fff;
    border: 1px solid #868686;
    padding: 15px 20px;
    border-radius: 30px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    box-sizing: border-box;
    margin-left: auto;
    margin-right: auto;
}

/* Button variants */
.btn-red,
button.btn-red,
a.btn-red {
    border-color: #c56a6a !important;
}

.btn-green,
button.btn-green,
a.btn-green {
    border-color: #6db47e !important;
}

.btn-filled-green,
button.btn-filled-green,
a.btn-filled-green {
    background: #6db47e !important;
    color: #fff !important;
    border: none !important;
    margin-top: 60px;
    padding-left: 50px;
    padding-right: 50px;
}

button.btn.btn-add-more {
    margin-left: 0;
    padding: 7px 15px;
    height: auto;
}

button:disabled {
    background: #858585 !important;
}

/* Special buttons */
.reinvio-btn,
.reinvio-btn:visited {
    background: #6db47e;
    color: #fff;
    border: 0;
    padding: 10px 50px;
    border-radius: 30px;
    font-size: 16px;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 10px;
}

.reinvio-btn:hover {
    background: #5ca76d;
}

.logout-button {
    background: #fff;
    color: #bc5353;
    border: 1px solid #bc5353;
    padding: 15px 40px;
    border-radius: 30px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    margin: 0;
}

.logout-button button {
    border: 1px solid #bc5353;
    margin-top: 0;
}

a.link-button {
    background: #6db47e;
    color: #fff;
    text-decoration: none;
    line-height: 50px;
    display: inline-block;
    padding: 0 15px;
    border-radius: 30px;
}

/*.btn.btn-delete {
    padding: 10px 15px;
    height: auto;
    font-size: 14px;
}*/

/* ========================================================================
   HEADER & SECTION STYLES
   ======================================================================== */

/* Info header section */
.info-header {
    background: #f8f6f4;
    margin: -50px -36px 0;
    padding: 50px 36px;
    position: relative;
    border-bottom: 1px solid #b0854d;
}

.info-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

a.btn.info-header-home {
    margin-left: 0;
    margin-right: 0;
}

.info-header-columns {
    margin-top: 50px;
    text-align: left;
}

.info-header-title {
    margin: 0;
    color: #b0854d;
    font-family: "Unna", serif;
    font-size: 40px;
    font-weight: 400;
}

.info-header-actions {
    display: flex;
    flex-direction: column;
}

#accordion-header-actions {
    margin: 0;
}

.info-header-actions .btn {
    width: 100%;
    margin-right: auto;
    margin-left: 0;
}

.info-header-actions form {
    width: 100%;
}

.info-header .home-button {
    background: #fff;
    color: #868686;
    border: 1px solid #868686;
    border-radius: 30px;
    padding: 10px 40px;
    font-size: 16px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
    margin-left: auto;
    margin-top: 0;
    display: inline-block;
}

.info-header .home-button:hover {
    background: #f0f0f0;
    color: #333;
}

/* ========================================================================
   COLLABORATORI & CLIENTI
   ======================================================================== */

.collaboratore-box {
    margin-bottom: 32px;
}

.collaboratore-name {
    font-weight: bold;
    color: #b0854d;
    font-size: 20px;
    text-align: left;
}

.collaboratore-users-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
    margin-bottom: 12px;
}

.collaboratore-users-label {
    display: flex;
    align-items: center;
    background: #fff;
    padding-right: 20px;
    position: relative;
}

.collaboratore-users-label img {
    margin-right: 8px;
}

.collaboratore-users-text {
    font-size: 16px;
    color: #868686;
}

.collaboratore-users-badge {
    margin-left: auto;
    display: flex;
    align-items: center;
    position: relative;
}

.collaboratori-list {
    margin: 0;
    text-align: left;
}

.collaboratore-box-inner-header {
    position: relative;
    display: flex;
}

.collaboratore-box-inner-header::before {
    content: "";
    border-top: 1px solid #607d8b;
    position: absolute;
    top: 50%;
    display: block;
    left: 0;
    right: 0;
}

/* Clienti */
.clienti-list {
    width: 100%;
}

/* Accordion for clienti */
.accordion-client {
    border: 1px solid #868686;
    border-radius: 18px;
    margin: 20px 0;
    background: #fff;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

.accordion-event .accordion-client:first-child {
    margin-top: 0;
}

.accordion-client.open {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.19), 0 2px 6px rgba(0, 0, 0, 0.23);
}

.accordion-client.open {
    background: #f8e6c1;
    border-color: #b0854d;
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
}

.accordion-header span {
    color: #868686;
    height: 24px;
    line-height: 24px;
}

.accordion-header .arrow {
    line-height: 0;
}

.accordion-content {
    padding: 0 20px 14px 20px;
    color: #868686;
    text-align: left;
    flex-direction: column;
    align-items: flex-start;
}

/* ========================================================================
   BADGES
   ======================================================================== */

.badge-num {
    background: #6db47e;
    color: #fff;
    border-radius: 50%;
    border: 1px solid #868686;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge-num-zero {
    background: #fff !important;
    color: #868686 !important;
    border: 1px solid #bc5353 !important;
}

/* ========================================================================
   FORM STYLES
   ======================================================================== */

form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

form#dateForm #field-data,
form#dateForm #field-tipo,
form#dateForm #field-stato {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

input,
textarea,
button,
select {
    padding: 10px 35px;
}

textarea {
    padding-top: 20px;
    padding-bottom: 20px;
}

form label {
    font-size: 16px;
    background: #ffffff;
    width: auto;
    margin-bottom: -20px;
    margin-left: 40px;
    z-index: 1;
    padding: 0 15px;
    align-self: flex-start;
}

form input,
form button,
form select {
    box-sizing: border-box;
    height: 50px;
    border-radius: 30px;
    border: 1px solid #b0854d;
    font-size: 16px;
}

form select {
    background-color: #fff;
}

form textarea {
    box-sizing: border-box;
    border-radius: 20px;
    border: 1px solid #b0854d;
    font-size: 16px;
    line-height: 1.5;
}

form input+label,
form select+label,
form small+label {
    margin-top: 40px;
}

form small {
    text-align: left;
}

form input[type="submit"] .btn-filled-green,
form button .btn-filled-green {
    margin-top: 50px;
}

form input[type="date"] {
    align-self: flex-start;
    background-color: #fff;
    width: 100%;
}

.form-checkbox {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    margin-top: 40px;
}

.form-checkbox label {
    margin: 0;
    text-align: left;
}

input[type="checkbox"] {
    height: 15px;
}

form.activity-filter-form {
    flex-direction: column;
    display: flex;
    gap: 5px;
    align-items: flex-start;
    flex-wrap: wrap;
    max-width: 100%;
}

form.activity-filter-form label {
    margin: 0;
    background: inherit;
    padding: 0;
    display: flex;
    flex-direction: column;
    font-size: 14px;
}

form.activity-filter-form button {
    margin: 0;
}

form .collab-input-row {
    display: flex;
    flex-direction: row;
    margin-top: 40px;
}

form .collab-input-row:first-child {
    margin-top: 20px;
}

form .collab-input-row .collab-input {
    flex-grow: 1;
}

form .collab-input-row button.btn-red {
    border-color: transparent !important;
    padding-right: 0;
}

form .collab-input-wrapper {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

form .collab-input-wrapper label.collab-label {
    position: relative;
    top: -10px;
}

form.activity-filter-form input,
form.activity-filter-form .btn {
    border-radius: 2px;
    border-color: #ccc;
    height: 35px;
    padding: 10px;
}

/* ========================================================================
   CONFERMA & CONFIRMATION
   ======================================================================== */

.conferma-title {
    margin-bottom: 35px;
}

.info-header-details-row,
.confirm-container > div {
    margin-bottom: 20px;
}

.info-header-details-row span,
.confirm-container > div span {
    display: block;
    margin-bottom: 2px;
    font-size: 14px;
}

.confirm-container .confirm-message {
    margin-top: 50px;
}

.confirm-forms {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.confirm-forms form {
    flex: 1 0 0;
}

.confirm-forms form button {
    width: 100%;
    margin-top: 0;
    padding: 0;
}

.confirm-forms #confirm-form-back button {
    background: #fff;
    border: 1px solid #868686;
    color: #868686;
}

/* ========================================================================
   ACTIVITY LIST
   ======================================================================== */

#activity-list {
    background-color: #f8f6f4;
    margin: -25px -36px;
    padding: 75px 36px 60px;
    text-align: left;
}

.card-name {
    border-bottom: 1px solid #b0854d;
    padding-bottom: 15px;
    margin-bottom: 15px;
    color: #666C68;
}

.card-item {
    background-color: #fff;
    border: 1px solid #b0854d;
    padding: 20px;
    border-radius: 5px;
    display: block;
    margin: 10px 0;
    color: #333;
    text-decoration: none;
    box-shadow: 5px 5px 15px #dedede;
    border-radius: 30px;
}

.card-item:last-child {
    margin-bottom: 0;
}

.card-item .details-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
    gap: 1px;
}

.card-item .details-row .details-label {
    font-size: 12px;
    color: #999;
}

.card-item .details-row .details-value {
    font-size: 14px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.details-table {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
}

.details-table .details-row {
    flex: 0 0 calc(33.333% - 14px);
    min-width: 0;
    position: relative;
    margin-bottom: 0;
}

.details-table .details-row:not(:nth-child(3n)):not(:last-child)::after {
    content: "";
    position: absolute;
    right: -5px;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: #70707026;
}

.card-item .button-row {
    border-bottom: 0;
}

.card-item .button-row .btn {
    margin-left: 0;
    padding: 7px 15px;
}

/* ========================================================================
   CLIENTS MANAGER SECTION
   ======================================================================== */

.clients-manager {
    margin: 0px -36px;
    display: flex;
    flex-direction: column-reverse;
}

.clients-list-wrapper {
    padding: 50px 36px;
    flex: 1;
}

.event-list-wrapper {
    padding: 50px 36px;
    background-color: #F8F6F4;
    flex: 1;
}

#agenda-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

#agenda-title .btn {
    margin: 10px 0 0 0;
}

/* ========================================================================
   LOGOUT SECTION
   ======================================================================== */

.logout-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-top: 70px;
}

.logout-container .logout-email {
    text-align: left;
}

/* ========================================================================
   POPUP MODALS
   ======================================================================== */

.popupOverlay {
    display: none;
    position: fixed;
    top: 0px;
    left: 0px;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.popupWrapper {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    margin: 0 30px;
}

#delete-success-box {
    position: fixed;
    top: 24px;
    left: 10%;
    right: 10%;
    background: #b0854d;
    color: #fff;
    padding: 16px 32px;
    border-radius: 8px;
    z-index: 9999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    font-size: 16px;
    min-width: 220px;
    text-align: center;
}

/* ========================================================================
   GESTIONE DATE
   ======================================================================== */

.date-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.date-info {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.date-info span {
    text-align: left;
}

.edit-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
}

.add-btn {
    margin: 24px 0 0 0;
}

.popupOverlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.popupWrapper label {
    display: block;
    margin-top: 20px;
}

.popupWrapper .btn {
    margin-top: 18px;
    width: 100%;
}

/* ========================================================================
   VERSIONE DESKTOP
   ======================================================================== */

@media only screen and (min-width: 1200px) {
    .card-item {
        margin: 15px;
    }

    .card-name {
        max-width: 100%;
    }

    .card-item:last-child {
        margin-bottom: 15px;
    }

    .activity-items-wrapper {
        display: grid;
        grid-template-columns: 25% 25% 25% 25%;
        margin: 0 -15px;
    }

    form.activity-filter-form {
        flex-direction: row;
        align-items: flex-end;
    }

    #accordion-header-actions {
        cursor: initial;
    }

    #accordion-header-actions .arrow {
        display: none;
    }

    .clienti-accordion-detail {
        flex: 1;
        margin-bottom: 0;
        flex-direction: column;
        align-items: flex-start;
    }

    .clienti-accordion-detail.actions {
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
    }

    select.stato-nominativo-select {
        text-align: left;
    }

    select.stato-nominativo-select {
        width: auto;
    }

    .info-header-columns {
        display: flex;
        gap: 50px;
        justify-content: space-between;
    }

    .info-header-details {
        display: flex;
        gap: 100px;
    }

    #accordion-header-actions .accordion-content {
        display: flex !important;
    }

    .clienti-accordion-detail > div {
        flex-direction: row;
        align-items: center;
    }

    .clients-manager {
        flex-direction: row;
    }

    #agenda-title {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    #agenda-title .btn {
        margin: 0;
    }

    .event-list-wrapper {
        margin-bottom: -50px;
    }

    .client-info-grid {
        flex-direction: row;
    }

    .client-actions-grid {
        flex-direction: row;
        align-items: center;
    }

}