/*
 * FantaCapi - Foglio di Stile Principale
 */

/* Import Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* Impostazioni di base */
body {
    font-family: 'Inter', sans-serif;
    background-color: #111827; /* blu notte */
    color: #d1d5db;            /* grigio chiaro */
    overflow-x: hidden;
}

.protected-image {
    pointer-events: none;
}

/* ===========================
   Form
   =========================== */
.form-input {
    background-color: #1f2937;
    border: 1px solid #4b5563;
    color: #ffffff;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
    outline: none;
    border-color: #eab308; /* giallo brand */
    box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.4);
}
.form-input::placeholder {
    color: #9ca3af;
}

/* ===========================
   Pulsanti
   =========================== */
.btn-primary {
    background-color: #eab308; /* giallo brand */
    color: #111827;
    font-weight: 700;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    transition: background-color 0.2s;
    border: none;
    cursor: pointer;
}
.btn-primary:hover { background-color: #f59e0b; }

.btn-secondary {
    background-color: #374151;
    color: #ffffff;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    transition: background-color 0.2s;
    border: 1px solid #4b5563;
    cursor: pointer;
}
.btn-secondary:hover { background-color: #4b5563; }

.btn-edit {
    background-color: #3b82f6;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}
.btn-edit:hover { background-color: #2563eb; }

.btn-danger {
    background-color: #ef4444;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}
.btn-danger:hover { background-color: #dc2626; }

/* ===========================
   Tabelle - stile classico
   (scroll orizzontale gestito dal wrapper overflow-x-auto)
   =========================== */
.admin-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    table-layout: auto;
}
.admin-table thead { background-color: #374151; }
.admin-table th, .admin-table td {
    padding: 1.25rem 1rem;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid #374151;
}
.admin-table th {
    font-size: 0.875rem;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.admin-table tbody tr:hover { background-color: rgba(234, 179, 8, 0.05); }

/* Varianti opzionali per tabelle */
.table-compact th,
.table-compact td {
    padding: 0.6rem 0.55rem !important; /* più serrata */
}
.table-compact th { font-size: 0.85rem; }

/* Evita a capo (per numeri/date/azioni) */
.table-nowrap th,
.table-nowrap td {
    white-space: nowrap;
}

/* ===========================
   Tab / Classifica
   =========================== */
.tab-container {
    display: flex;
    border-radius: 0.75rem;
    background-color: #1f2937;
    border: 1px solid #4b5563;
    overflow: hidden;
}
.tab-button {
    width: 50%;
    padding: 0.75rem 1rem;
    text-align: center;
    font-weight: 600;
    color: #9ca3af;
    background-color: transparent;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}
.tab-button.active { color: #111827; background-color: #eab308; }
.rank-1 { color: #facc15; font-weight: 900; font-size: 1.2rem; }
.rank-2 { color: #d1d5db; font-weight: 900; font-size: 1.2rem; }
.rank-3 { color: #f97316; font-weight: 900; font-size: 1.2rem; }

/* ===========================
   Dashboard / Card varie
   =========================== */
.bulletin-board {
    background-color: #854d27;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40"><path d="M.5 19.5l19-19 19 19-19 19z" fill-opacity=".03" fill="%23000"/></svg>');
    border: 12px solid #38281d;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.5), 0 10px 20px rgba(0,0,0,0.5);
    border-radius: 1rem;
    padding: 2rem;
    min-height: 350px;
    position: relative;
}
.bulletin-board .capo-on-board p { color: #f3eacb; text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7); }
.capo-on-board::after {
    content: '';
    position: absolute; top: -5px; left: 50%; transform: translateX(-50%);
    width: 16px; height: 16px; background-color: #f59e0b;
    border-radius: 50%; border: 2px solid #fef08a; box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}
.bench-container {
    margin-top: 2rem; background-color: #374151; padding: 1rem;
    border-radius: 0.75rem; border: 1px solid #4b5563;
}
.bench-title {
    text-align: center; font-weight: 700; color: #9ca3af;
    margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 0.1em;
}
.capitano-badge {
    position: absolute; top: -8px; right: -8px; background-color: #f59e0b; color: #1f2937;
    border-radius: 50%; width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
    font-weight: bold; font-size: 14px; border: 2px solid white; z-index: 10;
}

/* ===========================
   Cropper
   =========================== */
.cropper-modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(17, 24, 39, 0.8); backdrop-filter: blur(5px); align-items: center; justify-content: center; }
.cropper-modal.is-active { display: flex; }
.cropper-modal-content { background-color: #1f2937; padding: 2rem; border-radius: 1rem; width: 90%; max-width: 500px; border: 1px solid #4b5563; box-shadow: 0 10px 25px rgba(0,0,0,0.5); }
.cropper-container { height: 300px; background-color: #111827; }
#image-to-crop { display: block; max-width: 100%; }
.cropper-view-box, .cropper-face { border-radius: 50%; outline: none; box-shadow: 0 0 0 2px #eab308; }
.image-upload-preview {
    width: 150px; height: 150px; background-color: #374151; border: 3px dashed #4b5563; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; cursor: pointer; overflow: hidden;
    margin: 0 auto 1.5rem auto; position: relative; transition: border-color 0.2s;
}
.image-upload-preview:hover { border-color: #eab308; }
.image-upload-preview .icon { font-size: 2rem; color: #9ca3af; }
.image-upload-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ===========================
   Footer Mobile
   =========================== */
.nav-link {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #9ca3af; transition: color 0.2s ease-in-out; flex-grow: 1; padding: 0.5rem 0;
    position: relative; text-decoration: none;
}
.nav-link:hover { color: #ffffff; }
.nav-link i { font-size: 1.25rem; margin-bottom: 0.25rem; transition: transform 0.2s ease-in-out; }
.nav-text { font-size: 0.75rem; font-weight: 500; transition: all 0.2s ease-in-out; padding: 2px 8px; border-radius: 9999px; }
.nav-link.active i { color: #eab308; transform: scale(1.1); }
.nav-link.active .nav-text { color: #111827; background-color: #eab308; font-weight: 600; }

/* ===========================
   Cronologia scrollabile (X)
   =========================== */
.cronologia-wrapper {
    overflow-x: auto;
    max-height: 400px;
    border: 1px solid #374151;
    border-radius: 0.75rem;
    background-color: #1f2937;
}
.cronologia-wrapper::-webkit-scrollbar { height: 8px; width: 8px; }
.cronologia-wrapper::-webkit-scrollbar-track { background: #1f2937; border-radius: 10px; }
.cronologia-wrapper::-webkit-scrollbar-thumb { background: #4b5563; border-radius: 10px; }
.cronologia-wrapper::-webkit-scrollbar-thumb:hover { background: #6b7280; }

/* ===========================
   Cookie Banner
   =========================== */
.cookie-banner {
    position: fixed; bottom: 0; left: 0; right: 0;
    background-color: #1f2937; color: #d1d5db; padding: 1rem; z-index: 1000;
    border-top: 1px solid #4b5563; display: none; transform: translateY(100%); transition: transform 0.3s ease-in-out;
}
.cookie-banner.is-visible {
    display: flex; flex-direction: column; gap: 0.75rem; transform: translateY(0);
}
@media (min-width: 768px) {
    .cookie-banner.is-visible { flex-direction: row; align-items: center; justify-content: space-between; }
}
.cookie-banner-text a { color: #eab308; text-decoration: underline; }
.cookie-banner-text a:hover { color: #f59e0b; }