/* Styles comuni per tutto il sito */

:root {
    --primary-color: #4f46e5;
    /* Indaco 600 */
    --primary-hover: #4338ca;
    /* Indaco 700 */
    --secondary-color: #ec4899;
    /* Rosa 500 */
    --bg-gradient-start: #0f172a;
    /* Ardesia 900 */
    --bg-gradient-end: #1e293b;
    /* Ardesia 800 */
    --text-main: #f8fafc;
    /* Ardesia 50 */
    --text-muted: #94a3b8;
    /* Ardesia 400 */
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --ti-cursor-color: var(--text-muted);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Elementi di Animazione Sfondo */
.bg-blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    z-index: -1;
    animation: float 10s infinite ease-in-out;
    pointer-events: none;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: var(--primary-color);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: var(--secondary-color);
    animation-delay: -5s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(30px, 20px);
    }
}

/* Navbar */
.navbar {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

.navbar.inactive {
    filter: grayscale(80%);
    pointer-events: none;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.025em;
}

/* Sezione Hero */
.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Cursore TypeIt visibile anche con testo gradiente */
.hero h1 .ti-cursor {
    -webkit-text-fill-color: var(--text-muted);
    background: none;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin-bottom: 3rem;
    line-height: 1.6;
}

/* Container Card */
.cards-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    width: 100%;
    max-width: 1220px;
    padding: 0 1rem;
}

/* Scheda Effetto Vetro (Glass Card) */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    padding: 3rem;
    border-radius: 1.5rem;
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    width: 100%;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.glass-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Pulsante Login */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
    min-height: 64px;
}

.btn-google:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4);
}

.btn-google svg {
    width: 24px;
    height: 24px;
}

/* Pulsante Admin */
.btn-admin {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-admin:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Footer */
footer {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--glass-border);
    margin-top: auto;
    width: 100%;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .glass-card {
        padding: 2rem;
    }
}

/* Loghi */
.btn-google-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

up-logo {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

/* Glass Card Statica (Senza Effetto Hover) */
.static-glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    padding: 3rem;
    border-radius: 1.5rem;
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    width: 100%;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Overlay Modale */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    width: 100%;
    justify-content: center;
}

/* Pulsanti Modale */
.btn-danger {
    padding: 0.75rem 1.5rem;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-warning {
    padding: 0.75rem 1.5rem;
    background: #f4a826;
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-warning:hover {
    background: #ef9a08;
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    /* Allows clicking through the container */
}

.toast {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    min-width: 300px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    pointer-events: auto;
    animation: toast-in 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    opacity: 1;
    transform: translateY(0);
}

.toast.hiding {
    animation: toast-out 0.3s ease-in forwards;
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.toast.warning {
    border-left: 4px solid #f59e0b;
}

.toast-icon {
    font-size: 1.25rem;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
}

/* Animazione errore (shake) */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.shake-animation {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

/* Stile messaggio errore */
.error-text {
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: none;
    /* Nascosto di default */
}

.btn-primary {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

/* Highlighting per Ruoli */
.text-tutor {
    color: #847ef0 !important;
    font-weight: 600;
}

.text-admin {
    color: #f59e0b !important;
    /* Amber / Gold */
    font-weight: 600;
}

/* Global Suggestions Dropdown Styles */
.suggestions-dropdown {
    box-sizing: border-box;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 1100 !important;
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    margin-top: 0.25rem;
    background: #1e293b !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.suggestion-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    color: var(--text-main);
    border-radius: 4px;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: left;
}

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

.suggestion-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ===== Pannello Filtri (Standardizzato) ===== */
.filter-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.filter-wrapper.open {
    grid-template-rows: 1fr;
    transition: grid-template-rows 0.5s cubic-bezier(0.4, 0, 0.2, 1) 0s;
}

.filter-panel {
    min-height: 0;
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    overflow: hidden;
    padding: 1.5rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    visibility: hidden;
}

.filter-wrapper.open .filter-panel {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    transition: opacity 0.4s ease 0.3s, transform 0.4s ease 0.3s;
}

.filter-panel-content {
    overflow: hidden;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .filter-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .filter-grid {
        grid-template-columns: 1fr;
    }
}

.filter-buttons {
    margin-top: 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.form-control {
    width: 100%;
    padding: 0.8rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.08);
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Correzione Visibilità Opzioni Select Dropdown */
select option {
    background-color: #1e293b;
    color: #f8fafc;
    padding: 10px;
}

/* ===== Admin Slider Layout ===== */
.slider-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.slider-track {
    display: flex;
    width: 300%;
    /* 3 Pannelli */
    height: 100%;
    transform: translateX(-33.333%);
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.slide-panel {
    width: 33.333%;
    flex-shrink: 0;
    padding: 2rem;
    box-sizing: border-box;
    overflow-y: auto;
    opacity: 0.3;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.slide-panel.active {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 768px) {
    .slide-panel {
        padding: 1.5rem 1rem;
    }
}

/* Admin Split Grid (Menu Centrale) */
.admin-split-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
    height: 100%;
    align-items: flex-start;
}

@media (max-width: 992px) {
    .admin-split-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding-bottom: 2rem;
    }
}

/* Colonna Admin */
.admin-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Card Opzione Admin */
.admin-option-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.admin-option-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.admin-option-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

@media (max-width: 768px) {
    .admin-option-icon {
        font-size: 2.25rem;
    }
}

/* Pulsante Indietro */
.back-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 0;
}

.back-btn:hover {
    color: var(--text-main);
}

/* Fade Animation */
.fade-in {
    animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading spinner inline */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: approveSpinAnim 0.6s linear infinite;
}

@keyframes approveSpinAnim {
    to {
        transform: rotate(360deg);
    }
}

.responsive-table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    border-radius: 8px;
}

.title-section {
    text-align: center;
    margin-bottom: 2rem;
}