/* Reset e base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-dark: #2a2a2a;
    --bg-darker: #1a1a1a;
    --text-white: #ffffff;
    --text-gray: #cccccc;
    --orange: #FF6600;
    --orange-dark: #e55a00;
    --success: #4caf50;
    --error: #f44336;
    --card-bg: #333333;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-white);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
}

/* Header */
header {
    background-color: var(--bg-darker);
    padding: 15px 0 10px;
    margin-bottom: 20px;
}

.header-top {
    margin-bottom: 15px;
}

.logo-image {
    max-height: 60px;
    width: auto;
    display: block;
    margin-bottom: 5px;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 3px;
}

.logo .orange {
    color: var(--orange);
}

.tagline {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-gray);
    margin: 0;
}

.header-title-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.header-actions-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.header-actions-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.header-spacer {
    width: 80px; /* Stessa larghezza delle icone per bilanciare */
    flex-shrink: 0;
}

/* Titoli */
.page-title {
    font-size: 1.6rem;
    margin: 0;
    text-align: center;
    color: var(--text-white);
    font-weight: 600;
    flex: 1;
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

/* Lista corsi */
.corsi-list {
    display: grid;
    gap: 20px;
}

.corso-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 25px;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: 2px solid transparent;
}

.corso-card:hover {
    transform: translateY(-2px);
    border-color: var(--orange);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}

.corso-card h3 {
    color: var(--orange);
    margin-bottom: 15px;
    font-size: 1.6rem;
}

.corso-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.corso-info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

.corso-info-item strong {
    color: var(--text-gray);
    min-width: 120px;
}

.posti-disponibili {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 10px;
}

.posti-disponibili.alto {
    color: var(--success);
}

.posti-disponibili.medio {
    color: var(--orange);
}

.posti-disponibili.basso {
    color: var(--error);
}

.corso-completo {
    background-color: var(--card-bg);
    border: 2px solid var(--error);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
}

.corso-completo h3 {
    color: var(--error);
}

/* Form */
.form-container {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-white);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 18px;
    font-size: 1.1rem;
    background-color: var(--bg-dark);
    border: 2px solid #444;
    border-radius: 8px;
    color: var(--text-white);
    transition: border-color 0.2s;
    font-family: inherit;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--orange);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-gray);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

/* Palette colori */
.color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.color-palette input[type="radio"] {
    display: none;
}

.color-option {
    display: inline-block;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.color-option:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.color-palette input[type="radio"]:checked + .color-option {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.3), 0 4px 8px rgba(0, 0, 0, 0.3);
    transform: scale(1.15);
}

.color-option span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Bottoni */
.btn {
    display: inline-block;
    padding: 18px 35px;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    margin-top: 10px;
}

.btn-primary {
    background-color: var(--orange);
    color: var(--text-white);
}

.btn-primary:hover {
    background-color: var(--orange-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: #555;
    color: var(--text-white);
}

.btn-secondary:hover {
    background-color: #666;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Pagina dettaglio */
.dettaglio-corso {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
}

.dettaglio-corso h2 {
    color: var(--orange);
    margin-bottom: 20px;
}

.info-grid {
    display: grid;
    gap: 15px;
    margin-bottom: 25px;
}

.info-item {
    font-size: 1.1rem;
}

.info-item strong {
    color: var(--text-gray);
    display: inline-block;
    min-width: 150px;
}

/* Pagina conferma */
.conferma-container {
    text-align: center;
    padding: 40px 20px;
}

.conferma-icon {
    font-size: 4rem;
    color: var(--success);
    margin-bottom: 20px;
}

.conferma-container h2 {
    color: var(--success);
    margin-bottom: 20px;
}

.conferma-container p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: var(--text-gray);
}

/* Admin */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 25px 30px;
    background: linear-gradient(135deg, var(--bg-darker) 0%, var(--card-bg) 100%);
    border-radius: 12px;
    border: 2px solid rgba(255, 102, 0, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.admin-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-header-left a {
    display: inline-block;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.admin-header-left a:hover {
    opacity: 0.8;
}

.admin-logo-image {
    max-height: 40px;
    width: auto;
    display: block;
}

.admin-header h1 {
    color: var(--orange);
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
}

.admin-header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}


.admin-nav {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.admin-nav a {
    padding: 15px 25px;
    background-color: var(--card-bg);
    color: var(--text-white);
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.1rem;
    transition: all 0.2s;
}

.admin-nav a:hover,
.admin-nav a.active {
    background-color: var(--orange);
}

.admin-nav-frontend {
    background-color: var(--success) !important;
    font-weight: 600;
}

.admin-nav-frontend:hover {
    background-color: #45a049 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Tabella admin */
.table-container {
    overflow-x: auto;
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.1rem;
}

table th {
    background-color: var(--bg-darker);
    padding: 15px;
    text-align: left;
    color: var(--orange);
    font-weight: 600;
}

table td {
    padding: 15px;
    border-bottom: 1px solid #444;
}

table tr:hover {
    background-color: #3a3a3a;
}

/* Bottoni azioni */
.btn-small {
    padding: 10px 20px;
    font-size: 1rem;
    margin: 0 5px;
}

.btn-danger {
    background-color: var(--error);
}

.btn-danger:hover {
    background-color: #d32f2f;
}

.btn-success {
    background-color: var(--success);
}

.btn-success:hover {
    background-color: #45a049;
}

/* Login */
.login-container {
    max-width: 500px;
    margin: 100px auto;
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 40px;
}

.login-container h1 {
    text-align: center;
    color: var(--orange);
    margin-bottom: 30px;
}

/* Alert */
.alert {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.alert-success {
    background-color: rgba(76, 175, 80, 0.2);
    border: 2px solid var(--success);
    color: var(--success);
}

.alert-error {
    background-color: rgba(244, 67, 54, 0.2);
    border: 2px solid var(--error);
    color: var(--error);
}

.alert-warning {
    background-color: rgba(255, 102, 0, 0.2);
    border: 2px solid var(--orange);
    color: var(--orange);
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    font-size: 1.2rem;
    color: var(--text-gray);
}

/* Responsive Admin Header */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }
    
    .admin-header-left,
    .admin-header-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .admin-header h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .admin-header {
        padding: 15px;
    }
    
    .admin-header h1 {
        font-size: 1.3rem;
    }
    
    .admin-header-right {
        gap: 10px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 12px 0;
        margin-bottom: 15px;
    }
    
    .logo-image {
        max-height: 50px;
    }
    
    .logo h1 {
        font-size: 1.6rem;
        margin-bottom: 2px;
    }
    
    .admin-logo-image {
        max-height: 35px;
    }
    
    .tagline {
        font-size: 0.7rem;
    }
    
    .header-title-section {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        padding-top: 12px;
    }
    
    .header-spacer {
        display: none;
    }
    
    .page-title {
        font-size: 1.3rem;
        width: 100%;
        order: 1;
    }
    
    .view-toggle-inline {
        order: 2;
        align-self: center;
    }
    
    .view-btn-icon {
        min-width: 40px;
        height: 40px;
        padding: 8px 10px;
        font-size: 1.2rem;
    }
    
    .view-btn-icon span {
        font-size: 1.2rem;
    }
    
    .corso-card {
        padding: 20px;
    }
    
    .corso-card h3 {
        font-size: 1.4rem;
    }
    
    .form-container {
        padding: 20px;
    }
    
    table {
        font-size: 0.9rem;
    }
    
    table th,
    table td {
        padding: 10px;
    }
    
    .admin-nav {
        flex-direction: column;
    }
    
    .admin-nav a {
        text-align: center;
    }
}

/* Checkbox personalizzato */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.checkbox-group input[type="checkbox"] {
    width: 30px;
    height: 30px;
    cursor: pointer;
}

.checkbox-group label {
    margin: 0;
    cursor: pointer;
    font-size: 1.1rem;
}

/* Autocomplete */
.autocomplete-wrapper {
    position: relative;
}

.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-darker);
    border: 3px solid var(--orange);
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 8px 24px rgba(255, 102, 0, 0.4);
    margin-top: 2px;
}

.autocomplete-suggestions.show {
    display: block;
}

.autocomplete-suggestion {
    padding: 18px 20px;
    cursor: pointer;
    font-size: 1.2rem;
    border-bottom: 2px solid #444;
    transition: all 0.2s;
    color: var(--text-white);
    font-weight: 500;
    min-height: 60px;
    display: flex;
    align-items: center;
}

.autocomplete-suggestion:last-child {
    border-bottom: none;
}

.autocomplete-suggestion:hover,
.autocomplete-suggestion.selected {
    background-color: var(--orange);
    color: var(--text-white);
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(255, 102, 0, 0.3);
    font-weight: 600;
}

.autocomplete-suggestion strong {
    font-weight: 700;
    color: var(--orange);
}

.autocomplete-suggestion:hover strong,
.autocomplete-suggestion.selected strong {
    color: var(--text-white);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.autocomplete-no-results {
    padding: 20px;
    color: var(--text-gray);
    font-style: italic;
    font-size: 1.1rem;
    text-align: center;
    background-color: var(--card-bg);
    border-radius: 8px;
    margin: 5px;
}

/* Scrollbar personalizzata per autocomplete */
.autocomplete-suggestions::-webkit-scrollbar {
    width: 12px;
}

.autocomplete-suggestions::-webkit-scrollbar-track {
    background: var(--bg-dark);
    border-radius: 6px;
}

.autocomplete-suggestions::-webkit-scrollbar-thumb {
    background: var(--orange);
    border-radius: 6px;
}

.autocomplete-suggestions::-webkit-scrollbar-thumb:hover {
    background: var(--orange-dark);
}

/* Corsi ricorsivi */
.corso-ricorsivo-generato {
    background-color: rgba(255, 102, 0, 0.1);
    border-left: 4px solid var(--orange);
}

.corso-ricorsivo-generato:hover {
    background-color: rgba(255, 102, 0, 0.2);
}

/* Corso ricorsivo figlio (ricorrenza indentata) */
.corso-ricorsivo-figlio {
    background-color: rgba(255, 102, 0, 0.05);
    border-left: 3px solid rgba(255, 102, 0, 0.6);
    opacity: 0.95;
    transition: all 0.3s ease;
}

.corso-ricorsivo-figlio:hover {
    background-color: rgba(255, 102, 0, 0.15);
    opacity: 1;
}

.corso-ricorsivo-figlio td:first-child {
    padding-left: 30px;
}

/* Pulsante espandi/contrarre ricorrenze */
.btn-espandi-ricorsione {
    background-color: var(--orange);
    color: white;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    padding: 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-espandi-ricorsione:hover {
    background-color: var(--orange-dark);
    transform: scale(1.1);
}

.btn-espandi-ricorsione:active {
    transform: scale(0.95);
}

.btn-espandi-ricorsione .icon-espandi {
    display: inline-block;
    transition: transform 0.2s ease;
    user-select: none;
}

.corso-principale td:first-child {
    position: relative;
}

/* Corso padre ricorsivo */
tr[data-corso-padre]:not(.corso-ricorsivo-generato):not(.corso-ricorsivo-figlio) {
    border-top: 2px solid var(--orange);
}

tr[data-corso-padre]:not(.corso-ricorsivo-generato):not(.corso-ricorsivo-figlio) + tr.corso-ricorsivo-figlio {
    border-top: none;
}

/* Corso in festività */
.corso-festivita {
    background-color: rgba(211, 47, 47, 0.15);
    border-left: 4px solid #d32f2f;
}

.corso-festivita:hover {
    background-color: rgba(211, 47, 47, 0.25);
}

.badge-festivita {
    display: inline-block;
    background-color: #d32f2f;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: bold;
    margin-top: 5px;
    box-shadow: 0 2px 4px rgba(211, 47, 47, 0.3);
}

/* Toggle visualizzazione inline */
.view-toggle-inline {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.view-btn-icon {
    background-color: var(--card-bg);
    color: var(--text-white);
    border: 2px solid #444;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.3rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
}

.view-btn-icon:hover {
    background-color: #3a3a3a;
    border-color: var(--orange);
    transform: scale(1.05);
}

.view-btn-icon.active {
    background-color: var(--orange);
    border-color: var(--orange);
    color: var(--text-white);
}

.view-btn-icon span {
    font-size: 1.3rem;
    line-height: 1;
}

/* Pulsante disiscrizione */
.btn-disiscrizione {
    background-color: var(--card-bg);
    color: var(--text-white);
    border: 2px solid #444;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-disiscrizione span:first-child {
    font-size: 1.2rem;
}

.btn-disiscrizione-text {
    font-size: 0.95rem;
    font-weight: 500;
}

.btn-disiscrizione:hover {
    background-color: #3a3a3a;
    border-color: #d32f2f;
    transform: scale(1.05);
    color: #d32f2f;
}

/* Step modal disiscrizione */
.disiscrizione-step {
    margin-top: 20px;
}

.corso-iscritto-item {
    transition: all 0.2s ease;
}

.corso-iscritto-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn-disiscrivi-corso:hover {
    background-color: #b71c1c !important;
    transform: scale(1.05);
}

/* Calendario */
.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px 20px;
    background-color: var(--card-bg);
    border-radius: 12px;
}

.calendar-nav h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--orange);
    font-weight: 600;
}

.month-year-selector {
    cursor: pointer;
    transition: all 0.2s;
    padding: 5px 10px;
    border-radius: 6px;
    user-select: none;
}

.month-year-selector:hover {
    background-color: rgba(255, 102, 0, 0.1);
    transform: scale(1.05);
}

/* Selettore mese/anno */
.month-year-picker {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
}

.picker-content {
    background-color: var(--card-bg);
    border-radius: 12px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    position: relative;
}

.picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid #444;
}

.picker-header h4 {
    margin: 0;
    color: var(--orange);
    font-size: 1.3rem;
}

.picker-close {
    font-size: 28px;
    color: var(--text-gray);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.picker-close:hover {
    color: var(--text-white);
}

.picker-body {
    padding: 20px;
}

.picker-section {
    margin-bottom: 20px;
}

.picker-section label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-white);
    font-weight: 600;
    font-size: 0.9rem;
}

.picker-select {
    width: 100%;
    padding: 12px;
    background-color: var(--bg-dark);
    color: var(--text-white);
    border: 2px solid #444;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.picker-select:hover {
    border-color: var(--orange);
}

.picker-select:focus {
    outline: none;
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.2);
}

.picker-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.picker-actions .btn {
    flex: 1;
    padding: 12px;
    font-size: 1rem;
}

.btn-nav {
    background-color: var(--orange);
    color: var(--text-white);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
}

.btn-nav:hover {
    background-color: var(--orange-dark);
    transform: scale(1.1);
}

.calendar-container {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.calendar-grid {
    display: flex;
    flex-direction: column;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
    margin-bottom: 10px;
    width: 100%;
}

.calendar-day-header {
    text-align: center;
    font-weight: 600;
    color: var(--orange);
    padding: 10px;
    font-size: 1rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.calendar-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    width: 100%;
}

.calendar-day {
    min-height: 140px;
    background-color: var(--bg-dark);
    border: 2px solid #444;
    border-radius: 10px;
    padding: 10px;
    position: relative;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: visible;
}

.calendar-day:hover {
    border-color: var(--orange);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
    background-color: #2d2d2d;
}

.calendar-day.empty {
    background-color: transparent;
    border: none;
    cursor: default;
}

.calendar-day.empty:hover {
    transform: none;
    box-shadow: none;
}

.calendar-day.today {
    border-color: var(--orange);
    border-width: 3px;
    background-color: rgba(255, 102, 0, 0.15);
    box-shadow: 0 0 0 2px rgba(255, 102, 0, 0.2);
}

.calendar-day.today .day-number {
    color: var(--orange);
    font-weight: 800;
    font-size: 1.2rem;
}

/* Festività - evidenziazione in rosso */
.calendar-day.festivita {
    border-color: #f44336;
    border-width: 3px;
    background-color: rgba(244, 67, 54, 0.15);
    box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.2);
}

.calendar-day.festivita .day-number {
    color: #f44336;
    font-weight: 800;
    font-size: 1.2rem;
}

.calendar-day.festivita.today {
    border-color: #f44336;
    background-color: rgba(244, 67, 54, 0.25);
    box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.3);
}

.calendar-day.festivita.today .day-number {
    color: #f44336;
}

.festivita-label {
    font-size: 0.7rem;
    color: #f44336;
    font-weight: 600;
    margin-bottom: 4px;
    padding: 2px 4px;
    background-color: rgba(244, 67, 54, 0.2);
    border-radius: 4px;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.day-number {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: var(--text-white);
    text-align: left;
    flex-shrink: 0;
}

/* Riduce dimensione numero giorno quando ci sono corsi */
.calendar-day.has-events .day-number {
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.calendar-day:has(.corsi-giorno) .day-number {
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.corsi-giorno {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-top: auto;
    flex: 1;
    overflow: visible;
    min-width: 0;
}

/* Corso in lista (stile semplice come esempio) */
.corso-lista {
    display: flex;
    align-items: center;
    padding: 2px 0;
    cursor: pointer;
    transition: all 0.15s;
    min-width: 0;
    line-height: 1.3;
    font-size: 0.7rem;
    position: relative;
}

.corso-lista:hover {
    background-color: rgba(255, 102, 0, 0.1);
    padding-left: 3px;
    padding-right: 3px;
    margin-left: -3px;
    margin-right: -3px;
    border-radius: 3px;
}

.corso-lista-nome {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-white);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Lista corsi */
.list-container {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.corsi-lista-view {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.corso-item-lista {
    background-color: var(--bg-dark);
    border: 2px solid #444;
    border-radius: 10px;
    padding: 15px 20px;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.corso-item-lista:hover {
    border-color: var(--orange);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
    /* Se ha un colore personalizzato, mantieni il colore ma aumenta l'opacità */
    /* background-color viene sovrascritto dallo style inline se presente */
}

.corso-item-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.corso-item-nome {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-white);
}

.corso-item-dettagli {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.corso-item-data {
    color: var(--text-white);
    font-weight: 600;
    background-color: rgba(255, 102, 0, 0.2);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
}

.corso-item-giorno {
    color: var(--orange);
    font-weight: 600;
}

.corso-item-ora {
    color: var(--text-gray);
    font-weight: 500;
}

.corso-item-posti {
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
}

.corso-item-posti.alto {
    background-color: rgba(76, 175, 80, 0.2);
    color: rgba(76, 175, 80, 0.9);
}

.corso-item-posti.medio {
    background-color: rgba(255, 152, 0, 0.2);
    color: rgba(255, 152, 0, 0.9);
}

.corso-item-posti.basso {
    background-color: rgba(244, 67, 54, 0.2);
    color: rgba(244, 67, 54, 0.9);
}

.link-dettagli {
    color: var(--text-gray);
    text-decoration: none;
    font-size: 1.2em;
    cursor: pointer;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.link-dettagli:hover {
    color: var(--orange);
    text-decoration: none;
}

.btn-iscriviti {
    background-color: var(--orange);
    color: var(--text-white);
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    white-space: nowrap;
}

.btn-iscriviti:hover {
    background-color: var(--orange-dark);
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(255, 102, 0, 0.4);
}

.btn-iscriviti:active {
    transform: scale(0.98);
}

@media (max-width: 768px) {
    
    .corso-item-lista {
        padding: 12px 15px;
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .corso-item-info {
        width: 100%;
    }
    
    .corso-item-nome {
        font-size: 1rem;
    }
    
    .corso-item-dettagli {
        font-size: 0.85rem;
        gap: 10px;
    }
    
    .btn-iscriviti {
        width: 100%;
        padding: 14px 20px;
        font-size: 1.1rem;
    }
}

/* Modal */
.modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    overflow-y: auto;
    padding: 20px;
}

.modal-content {
    background-color: var(--card-bg);
    margin: 50px auto;
    padding: 30px;
    border-radius: 12px;
    max-width: 600px;
    position: relative;
    border: 3px solid var(--orange);
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 2rem;
    font-weight: bold;
    color: var(--orange);
    cursor: pointer;
    line-height: 1;
    transition: transform 0.2s;
}

.modal-close:hover {
    transform: scale(1.2);
}

.modal-content h3 {
    color: var(--orange);
    margin-bottom: 20px;
    font-size: 1.8rem;
}

/* Responsive calendario */
@media (max-width: 768px) {
    .calendar-nav {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .calendar-nav h3 {
        font-size: 1.3rem;
        text-align: center;
        flex: 1;
    }
    
    .month-year-selector {
        padding: 3px 8px;
    }
    
    .picker-content {
        max-width: 90%;
        margin: 20px;
    }
    
    .picker-header {
        padding: 15px;
    }
    
    .picker-header h4 {
        font-size: 1.1rem;
    }
    
    .picker-body {
        padding: 15px;
    }
    
    .btn-nav {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
        flex-shrink: 0;
    }
    
    .calendar-container {
        padding: 10px;
        overflow-x: hidden;
    }
    
    .calendar-header {
        gap: 3px;
        margin-bottom: 5px;
        width: 100%;
    }
    
    .calendar-day-header {
        padding: 8px 2px;
        font-size: 0.75rem;
        font-weight: 700;
        text-align: center;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .calendar-week {
        gap: 3px;
        width: 100%;
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }
    
    .calendar-day {
        min-height: 110px;
        padding: 5px 3px;
        border-width: 2px;
        min-width: 0;
        width: 100%;
    }
    
    .calendar-day.empty {
        min-height: 0;
        padding: 0;
    }
    
    .day-number {
        font-size: 0.85rem;
        font-weight: 700;
        margin-bottom: 3px;
        text-align: center;
        padding: 2px;
    }
    
    .calendar-day.has-events .day-number,
    .calendar-day:has(.corsi-giorno) .day-number {
        font-size: 0.75rem;
        margin-bottom: 2px;
    }
    
    .calendar-day.festivita .day-number {
        font-size: 0.8rem;
    }
    
    .festivita-label {
        font-size: 0.6rem;
        padding: 1px 2px;
        margin-bottom: 2px;
    }
    
    .corsi-giorno {
        gap: 1px;
        margin-top: auto;
    }
    
    .corso-lista {
        padding: 2px 0;
        line-height: 1.25;
        font-size: 0.65rem;
    }
    
    .corso-lista-nome {
        font-size: 0.65rem;
    }
    
    .modal-content {
        margin: 10px auto;
        padding: 25px 20px;
        max-width: 95%;
    }
    
    .modal-close {
        right: 15px;
        top: 15px;
        font-size: 2.5rem;
    }
    
    .modal-content h3 {
        font-size: 1.5rem;
        margin-bottom: 15px;
        padding-right: 30px;
    }
}

@media (max-width: 480px) {
    .calendar-day {
        min-height: 115px;
        padding: 6px 3px;
    }
    
    .day-number {
        font-size: 0.8rem;
    }
    
    .calendar-day.has-events .day-number,
    .calendar-day:has(.corsi-giorno) .day-number {
        font-size: 0.7rem;
    }
    
    .calendar-day.festivita .day-number {
        font-size: 0.75rem;
    }
    
    .festivita-label {
        font-size: 0.55rem;
        padding: 1px 2px;
        margin-bottom: 1px;
    }
    
    .corso-lista {
        padding: 1px 0;
        line-height: 1.2;
        font-size: 0.6rem;
    }
    
    .corso-lista-nome {
        font-size: 0.6rem;
    }
    
    .calendar-nav {
        padding: 12px;
    }
    
    .calendar-nav h3 {
        font-size: 1.2rem;
    }
    
    .btn-nav {
        width: 48px;
        height: 48px;
        font-size: 1.4rem;
    }
    
    .calendar-day-header {
        font-size: 0.7rem;
        padding: 6px 1px;
    }
}

/* Footer */
.main-footer {
    background-color: var(--bg-darker);
    padding: 40px 0 30px;
    margin-top: 60px;
    border-top: 2px solid var(--orange);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.footer-section h3 {
    color: var(--orange);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.footer-address {
    color: var(--text-gray);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 12px;
}

.footer-legal {
    color: var(--text-gray);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 6px 0;
}

.footer-contacts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 20px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.contact-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 1rem;
    flex-shrink: 0;
}

.contact-icon.whatsapp {
    background-color: #25D366;
    color: white;
}

.contact-icon.phone {
    background-color: #f44336;
    color: white;
}

.contact-icon.facebook {
    background-color: #1877F2;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 1.2rem;
    font-weight: bold;
}

.contact-icon.instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    color: white;
}

.contact-icon.website {
    background-color: var(--orange);
    color: white;
}

.contact-icon.email {
    background-color: var(--orange);
    color: white;
}

.footer-contacts a {
    color: var(--text-white);
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.footer-contacts a:hover {
    color: var(--orange);
    text-decoration: underline;
}

.footer-developed {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.footer-developed p {
    color: var(--text-gray);
    font-size: 0.85rem;
    margin: 0;
}

.footer-developed a {
    color: var(--orange);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer-developed a:hover {
    color: var(--text-white);
    text-decoration: underline;
}

/* Responsive Footer */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .footer-section h3 {
        font-size: 1.3rem;
    }
    
    .footer-address {
        font-size: 0.95rem;
    }
    
    .footer-contacts {
        grid-template-columns: 1fr 1fr;
        gap: 10px 15px;
    }
    
    .contact-item {
        gap: 10px;
    }
    
    .contact-icon {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }
    
    .footer-contacts a {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .main-footer {
        padding: 30px 0 20px;
        margin-top: 40px;
    }
    
    .footer-section h3 {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    .footer-address {
        font-size: 0.9rem;
    }
    
    .footer-contacts {
        grid-template-columns: 1fr 1fr;
        gap: 8px 12px;
    }
    
    .contact-icon {
        width: 26px;
        height: 26px;
        font-size: 0.85rem;
    }
    
    .footer-contacts a {
        font-size: 0.9rem;
    }
}

/* Buttons row per iscritti */
.buttons-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    max-width: 600px;
}

@media (max-width: 768px) {
    .buttons-row {
        grid-template-columns: 1fr;
        max-width: 100%;
    }
}

