@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
    }
    
    .card-header .bi-chevron-down {
        color: white;
        font-weight: bold;
        font-size: 1.5em;
    }

    .container {
        max-width: 100% !important;
        padding: 0;
        margin-top: -0.25rem;
    }

    .row {
        margin: 0;
        width: 100vw;
        padding: 0;
    }

    .col-lg-8 {
        padding: 0;
        margin: 0;
        width: 100vw;
    }

    .card-responsive {
        max-width: 100% !important;
        width: 100% !important;
    }

    .card {
        margin: 0.7rem auto !important;
        width: 90vw !important;
        border-radius: 14px !important;
    }

    .card-header {
        padding: 1.4rem !important;
        border-top-left-radius: 16px;
        border-top-right-radius: 16px;
    }

    .dati {
        height: 3rem !important;
    }

    .card-body1 {
        padding: 1.4rem !important;
    }

    .card-body {
        padding-top: 0em !important;
        border-bottom-left-radius: 16px;
        border-bottom-right-radius: 16px;
    }

    .custom-logo {
        max-width: 100px !important;
    }

    .form-control,
    .form-select {
        font-size: 1.5em;
    }

    .col-lg-10 {
        padding: 0rem;
    }

    /* Toast Notifications */
    .toast-container {
        top: 10px !important;
        right: 10px !important;
        left: 10px !important;
        max-width: 100%;
    }

    .toast {
        width: 100%;
        max-width: 100%;
    }

    /* Mobile action buttons */
    .action-buttons {
        display: flex;
        justify-content: space-between;
        padding: 0.3rem 1rem;
        background: #f8f9fa;
        border-bottom: 1px solid #dee2e6;
        margin: 0.5rem 0;
    }

    .btn-outline-primary,
    .btn-logout {
        font-weight: bold;
        width: auto;
        padding: 0.3rem 0.3em;
        font-size: 1rem;
        border-radius: 0.2rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.3rem;
        height: 32px;
    }

    .btn-mobile {
        margin-left: 1rem;
        margin-right: 1rem;
        margin-top: 0.7rem;
    }

    .card-body {
        padding-top: 0.6em;
    }

    /* Icon-only buttons for mobile */
    .btn-outline-danger {
        position: relative;
        width: 45px;
        height: 45px;
        padding: 0;
        border: 1px solid #dc3545;
        background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23dc3545"><path d="M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zM19 4h-3.5l-1-1h-5l-1 1H5v2h14V4z"/><path d="M10 10h2v6h-2zm4 0h2v6h-2z" fill="%23fff"/></svg>') no-repeat center;
        background-size: 24px;
        text-indent: -9999px;
        overflow: hidden;
    }

    /* Hide badges on mobile */
    .badge {
        display: none !important;
    }

    /* Show tick mark on cancel button when registered */
    .btn-outline-danger.registered {
        overflow: visible;
        position: relative;
    }
    .btn-outline-danger.registered::after {
        content: '';
        position: absolute;
        top: -10px;
        right: -7px;
        width: 24px;
        height: 24px;
        background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%2328a745"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"/></svg>') no-repeat center;
        background-size: 14px;
        background-color: white;
        border-radius: 50%;
        border: 2px solid #28a745;
        box-shadow: 0 0 0 2px white;
        z-index: 10;
    }
    
    .btn-iscriviti {
        position: relative;
        width: 45px;
        height: 45px;
        padding: 0;
        border: none;
        background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23007bff"><path d="M3 17.25V21h3.75L17.81 9.94l-3.75-3.75L3 17.25zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75 1.83-1.83z"/></svg>') no-repeat center;
        background-size: 24px;
        text-indent: -9999px;
        overflow: hidden;
    }

   

}

/* Edit profile mobile fixes */
@media (max-width: 768px) {
    .form-control, .form-select {
        font-size: 16px !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .select2-container {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .select2-container--default {
        width: 100% !important;
    }
    
    .select2-container--default .select2-selection--single {
        font-size: 16px !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .select2-dropdown {
        max-width: 100vw !important;
        width: 100% !important;
    }
    
    .select2-container--open .select2-dropdown {
        left: 0 !important;
        right: 0 !important;
    }
    
    .col-md-6 {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    .row.g-3 {
        --bs-gutter-x: 0.25rem !important;
    }
    
    .card-body1 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}
