/* App custom styles - Bulma overrides */
body {
    font-family: 'Ubuntu', sans-serif;
}

/* Nessuna sottolineatura sui link al passaggio del mouse */
a:hover {
    text-decoration: none;
}
.button.is-ghost:hover,
.button.is-ghost:focus {
    text-decoration: none;
}

:root {
    --color-cakephp-red: #d33c43;
    --color-cakephp-gray: #404041;
    --color-cakephp-blue: #2f85ae;
    --color-cakephp-lightblue: #34bdd7;

    --bulma-size-small: 0.85rem; /* Facciamo il bottone small un filo più grande */
}

/* Content card */
.content-card {
    background: #fff;
    border-radius: 0.4rem;
    padding: 1.5rem;
    box-shadow: 0 7px 14px 0 rgba(60, 66, 87, 0.1),
        0 3px 6px 0 rgba(0, 0, 0, 0.07);
}

/* Table styling - W3CSS-like */
.table {
    font-size: 0.9rem;
    border-collapse: collapse;
}
.table thead th {
    background: var(--bulma-link);
    color: #fff;
    border-color: #4CAF50;
    padding: 0.5em 0.75em;
    font-weight: 500;
}
.table thead th a {
    color: #fff;
}
.table tbody tr:nth-child(even) {
    background-color: #fff9c4;
}
.table tbody tr:nth-child(odd) {
    background-color: #fff;
}
.table thead th,
.table tbody td,
.table tbody th {
    padding: 0.4em 0.75em;
    border: 1px solid #e0e0e0;
}
.table tbody tr:last-child td,
.table tbody tr:last-child th {
    border-bottom: 1px solid #e0e0e0;
}
.table.is-hoverable tbody tr:hover {
    background-color: #e8f5e9 !important;
}

/* Buttons - bordi coordinati per varianti is-light */
.button.is-info.is-light {
    border: 1px solid var(--bulma-info-dark);
}
.button.is-warning.is-light {
    border: 1px solid var(--bulma-warning-dark);
}
.button.is-danger.is-light {
    border: 1px solid var(--bulma-danger-dark);
}
.button.is-success.is-light {
    border: 1px solid var(--bulma-success-dark);
}
.button.is-primary.is-light {
    border: 1px solid var(--bulma-primary-dark);
}
.button.is-light {
    border: 1px solid #b5b5b5;
}

/* Actions column in tables */
.table td.actions,
.table th.actions {
    white-space: nowrap;
}
.table td.actions a {
    margin-right: 0.5rem;
}

/* Paginator - CakePHP pagination with Bulma styles */
.pagination-wrapper {
    margin-top: 1.5rem;
}
.pagination-wrapper .pagination {
    flex-wrap: wrap;
}
.pagination-wrapper .pagination-list {
    flex-grow: 1;
    flex-shrink: 1;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
}
.pagination-wrapper .pagination-list li {
    margin: 0.25rem;
}
.pagination-wrapper .pagination-list li a,
.pagination-wrapper .pagination-list li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.375em 0.625em;
    font-size: 1em;
    border: 1px solid #dbdbdb;
    border-radius: 4px;
    min-width: 2.5em;
    text-decoration: none;
    color: #363636;
}
.pagination-wrapper .pagination-list li a:hover {
    border-color: #b5b5b5;
}
.pagination-wrapper .pagination-list li.active a {
    background-color: var(--color-cakephp-blue);
    border-color: var(--color-cakephp-blue);
    color: #fff;
}
.pagination-wrapper .pagination-list li.disabled a,
.pagination-wrapper .pagination-list li.disabled span {
    cursor: not-allowed;
    opacity: 0.5;
    pointer-events: none;
}

/* Sort direction indicators */
.asc:after {
    content: " \2193";
}
.desc:after {
    content: " \2191";
}

/* CakePHP form field wrapper */
.input.field .control input,
.input.field .control select,
.input.field .control textarea {
    width: 100%;
}

/* Error container for non-debug mode */
.error-container {
    align-items: center;
    display: flex;
    flex-direction: column;
    height: 100vh;
    justify-content: center;
}

/* Fluid container - padding ridotto */
.container.is-fluid {
    padding-left: 12px;
    padding-right: 12px;
}

/* Section - padding ridotto per più spazio al contenuto */
main.section {
    padding: 1rem 0.75rem;
}

/* Navbar font size */
.navbar-item {
    font-size: 18px;
}

/* Footer minimal */
.footer {
    padding: 1.5rem;
}


.form-rows .field.is-horizontal {
    padding: 0.4rem 1rem;
    border: 1px solid #ddd;
    border-bottom: none;
    margin: 0;
}
.form-rows .field.is-horizontal:first-child {
    border-radius: 4px 4px 0 0;
}
.form-rows .field.is-horizontal:last-child {
    border-bottom: 1px solid #ddd;
    border-radius: 0 0 4px 4px;
}
.form-rows .field.is-horizontal:nth-child(odd) {
    background-color: #f8f8f8;
}

/* Appointments list - Row coloring by date */
.table tbody tr.apt-tomorrow td:first-child {
    border-left: 3px solid #ffc107;
}

.table tbody tr.apt-tomorrow td {
    background-color: #fffde7;
}

.table tbody tr.apt-tomorrow:hover td {
    background-color: #fffc9e !important;
}

.table tbody tr.apt-today td:first-child {
    border-left: 3px solid #e53935;
}

.table tbody tr.apt-today td {
    background-color: #ffebee;
}

.table tbody tr.apt-today:hover td {
    background-color: #ffcdd2 !important;
}

.table tbody tr.apt-past td {
    color: #aaa;
}
.table tbody tr.apt-past:hover td {
    color: #888;
}

/* Appointments list - Overlapping (conflicting) time ranges */
.table tbody tr.apt-conflict td:first-child {
    border-left: 3px solid #b71c1c !important;
}

.table tbody tr.apt-conflict td {
    background-color: #ff8a80 !important;
}

.table tbody tr.apt-conflict:hover td {
    background-color: #ff5252 !important;
}

/* Appointments list - Week separator row */
.table tbody tr.week-separator td {
    padding: 0;
    height: 0;
    border-top: 2px solid #b5b5b5;
    border-bottom: none;
    background-color: transparent !important;
}

/* Appointments list - Note column (truncated) */
.table td.note-cell {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Appointments list - ID column (monospace) */
.table td.is-family-monospace {
    font-family: 'Courier New', monospace;
}

/* Allinea verticalmente tutte le celle di una table */
.table td, .table th { vertical-align: middle; }

/* Allinea verticalmente tutte le checkbox dei form dinamici */
.field.is-horizontal .field-body .control input[type="checkbox"] { vertical-align: middle; }
.field.is-horizontal .field-body .field { display: flex; align-items: center; }
.field.is-horizontal .field-body .field .control { flex-grow: 1; }
