/* Global styles */
* {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* Layout and grid */
.row {
    display: flex;
    text-align: center;
    align-items: center;
    justify-content: center;
}

.container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
}

.containerlezioni {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
}

.containerlezionipage {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
}

.headerlogo {
    height: 150px;
}

.left {
    margin-right: -10px;
}

.link,
.profilename {
    color: black;
    font-weight: 300;
    text-decoration: none !important;
}

.left .link {
    margin-right: 30px;
}

.right .link,
.right .profilename {
    margin-left: 30px;
}

.link:hover,
.profilename:hover {
    font-weight: 400 !important;
}

.profilename {
    color: lightgray !important;
}

/* Hide/show elements */
.hide-desktop {
    display: none !important;
}

#menumobilelista {
    display: none;
}

@media (max-width: 1200px) {
    .hide-mobile {
        display: none !important;
    }

    .hide-desktop {
        display: block !important;
    }

    .hidden {
        display: none;
    }
    .containerlezioni {
        display: block !important;
    }
    .containerlezioni .card {
        margin-bottom: 20px; /* aggiunge spazio verticale tra le colonne */
    }
}

/* Card styles */
.cardlink {
    text-decoration: none;
    color: inherit;
}

.card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
}

.cardtitle {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: #212950;
}

.cardbody {
    font-size: 1rem;
    margin-bottom: 10px;
    color: #333;
}

.cardbody .avviso {
    font-size: 1rem;
    color: #e74c3c;
}

.cardbtn {
    display: inline-block;
    margin-top: 10px;
    font-weight: bold;
    color: #212950;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.disabilitato {
    pointer-events: none !important;
}

.disabilitato .cardtitle,
.disabilitato .cardbody,
.disabilitato .cardbtn {
    opacity: 0.5;
    filter: grayscale(80%);
}

.disabilitato .cardsubtitle {
    opacity: 1 !important;
    filter: grayscale(0%) !important;
}

.card .link {
    text-decoration: underline !important;
}

/* Layout desktop */
@media (min-width: 768px) {
    .container {
        flex-direction: row;
        justify-content: center;
        align-items: stretch;
    }

    .cardlink {
        flex: 1;
        max-width: 300px;
    }
}

/* Form styles */
.auth-form {
    max-width: 400px;
    margin: 20px auto;
    padding: 30px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.auth-form h2 {
    font-size: 1.8rem;
    color: #212950;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 700;
}

label {
    display: block;
    margin: 15px 0 5px;
    font-weight: 600;
    color: #333;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 10px;
    font-size: 1rem;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
    background-color: #fff;
    margin-bottom: 20px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #212950;
    outline: none;
}

input[type="date"] {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-calendar-picker-indicator {
    -webkit-appearance: none;
    display: inline-block;
    margin: 0;
}

.date-wrapper {
    overflow: hidden;
    width: 100%;
}

/* Buttons */
button {
    width: 100%;
    margin-top: 20px;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: #212950;
    color: white;
}

button:hover {
    background-color: #1a1f3d;
}

button:disabled, .button:disabled {
    background-color: #aaa;
    /* grigio chiaro */
    cursor: not-allowed;
    filter: grayscale(50%);
    opacity: 0.7;
}

/* Updated buttons: elimina-account and disdici-abbonamento */
.elimina-account,
.disdici-abbonamento,
.button {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border: none;
    text-decoration: none;
    text-align: center;
    display: inline-block;
}

.elimina-account {
    background-color: #dc3545;
    color: white;
}

.elimina-account:hover {
    background-color: #c9302c;
}

.disdici-abbonamento {
    background-color: #ffc107;
    color: black;
}

.disdici-abbonamento:hover {
    background-color: #e0a800;
    color: black;
}

.disdici-abbonamento.disabled {
    pointer-events: none;
    opacity: 0.6;
    filter: grayscale(70%);
    cursor: not-allowed;
}



/* Auth form alternative link */
.auth-form .auth-alt {
    margin-top: 20px;
    font-size: 0.9rem;
    text-align: center;
    color: #555;
}

.auth-form .auth-alt a {
    color: #212950;
    text-decoration: underline;
    font-weight: 600;
}

/* Checkbox */
.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 12px 0;
    font-size: 0.8rem;
    color: #777;
    line-height: 1.4;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    flex-direction: row;
}

.form-checkbox input[type="checkbox"] {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    accent-color: #212950;
    flex-shrink: 0;
    cursor: pointer;
}

.form-checkbox label {
    flex: 1;
    cursor: pointer;
}

/* Responsive checkbox */
@media screen and (min-width: 768px) {
    .form-checkbox {
        font-size: 0.9rem;
        gap: 12px;
    }

    .form-checkbox input[type="checkbox"] {
        width: 20px;
        height: 20px;
    }
}

/* Alerts */
.alert-success,
.alert-error,
.alert-message {
    border-radius: 12px;
    padding: 14px 20px;
    margin: 10px 0;
    font-size: 0.95rem;
    font-weight: 500;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Success alert */
.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 5px solid #28a745;
}

/* Error alert */
.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 5px solid #dc3545;
}

/* Message alert */
.alert-message {
    background-color: #212950;
    color: white;
    border-left: 5px solid #182950;
    max-width: 1200px !important;
}

/* Tables */
.table-container {
    overflow-x: auto;
    margin: 20px 0;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    font-size: 0.9rem;
    table-layout: auto;
}

thead {
    background-color: #212950;
    color: white;
}

thead th {
    padding: 12px 15px;
    font-weight: 600;
    text-align: left;
    vertical-align: middle;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

tbody tr {
    border-bottom: 1px solid #eaeaea;
    transition: background-color 0.2s ease;
}

tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

tbody tr:hover {
    background-color: #f1f4ff;
}

tbody td {
    padding: 12px 15px;
    color: #333;
    vertical-align: middle;
    word-break: break-word;
}

thead .subhead {
    background-color: #f3f3f3;
}

thead .subhead td {
    padding: 12px 15px;
    font-weight: 600;
    color: #212950;
}

/* Table action buttons */
.table-action-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.table-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: filter 0.2s ease, background-color 0.2s ease;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    position: relative;
    line-height: 1;
}

.btn-view {
    background-color: #f3f3f3;
    color: #212950;
    border: 1px solid #d1d5db;
}

.btn-view:hover {
    background-color: #e8eaf6;
}

.btn-edit {
    background-color: #212950;
    color: #fff;
}

.btn-edit:hover {
    filter: brightness(1.1);
}

.btn-delete {
    background-color: #dc3545;
    color: #fff;
}

.btn-delete:hover {
    filter: brightness(1.1);
}

.table-action-btn .fa-fw {
    width: 14px;
    text-align: center;
}

/* Tooltip */
.tooltip {
    position: relative;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    top: -32px;
    left: 50%;
    transform: translateX(-50%);
    background: #212950;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.6rem;
    white-space: nowrap;
    z-index: 5;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Disabled row */
.disabled-row {
    opacity: 0.5;
    filter: grayscale(70%);
    pointer-events: none;
}

/* Specific width */
#abbonamento, #certificato{
    width: 50% !important;
}

/* Responsive Mobile */
@media screen and (max-width: 768px) {
    table {
        font-size: 0.8rem;
    }

    thead th {
        padding: 10px 8px;
    }

    tbody td {
        padding: 10px 8px;
    }

    .table-action-btn {
        font-size: 0.6rem;
        padding: 4px 8px;
    }
    #abbonamento, #certificato{
        width: 100% !important;
    }
}

/* Playlist form */
.playlist-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 400px;
    margin: 2rem auto;
    margin-top: 5px !important;
    font-family: 'Inter', sans-serif;
}

.playlist-form label {
    font-size: 1rem;
    font-weight: 500;
    color: #333;
}

select {
    padding: 0.6rem 1rem;
    font-size: 1rem;
    border-radius: 10px;
    border: 1px solid #ccc;
    background-color: #f9f9f9;
    color: #333;
    transition: all 0.3s ease;
    cursor: pointer;
}

select:hover {
    border-color: #212950;
    /* verde chiaro Nutrifit */
    background-color: #fff;
}

select:focus {
    border-color: #212950;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 187, 106, 0.2);
}

/* Date wrapper */
.date-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 250px;
}

.date-wrapper input[type="number"] {
    flex: 1;
    margin-bottom: 0; /* evitare spaziatura extra rispetto al date */
}

.date-wrapper span {
    line-height: 1;
    font-size: 0.9rem;
    color: #333;
    white-space: nowrap;
}

/* Advantages list */
.vantaggi-list {
    list-style: none;
    padding: 0;
    margin: 15px 0;
}

.vantaggi-list li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 12px;
    font-size: 1rem;
    color: #333;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.vantaggi-list li::before {
    content: "✔";
    position: absolute;
    left: 0;
    top: 0;
    color: #212950;
    font-weight: bold;
}

/* Responsive fix for area-pericolosa buttons on mobile */
@media (max-width: 600px) {
    .area-pericolosa .hide-desktop a {
        display: block;
        width: 100%;
        box-sizing: border-box;
        text-align: center;
        margin: 10px 0;
        white-space: normal; /* permette il ritorno a capo */
    }
}