/* ===== VARIABILI COLORE TORNEOHUB (da Logo) ===== */
:root {
    --primary-color: #00d4ff; /* Blu ciano elettrico dal logo */
    --primary-dark: #1e3a5f; /* Blu scuro dal pallone */
    --accent-color: #a3ff00; /* Verde lime dal logo */
    --secondary-color: #6c757d;
    --success-color: #a3ff00; /* Verde lime per success */
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #00d4ff; /* Blu ciano per info */
    --dark-color: #2d2d2d; /* Nero dal testo logo */
}

/* ===== LAYOUT BASE ===== */
html, body {
    height: 100%;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #ffffff; /* SFONDO BIANCO */
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    background-color: #ffffff; /* SFONDO BIANCO */
}

/* ===== NAVBAR ===== */
.navbar-brand {
    font-size: 1.5rem;
    transition: transform 0.2s;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

.navbar-brand img,
.navbar-logo {
    height: 60px; /* Desktop: più grande e leggibile */
    margin-right: 0.5rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
}

.navbar-brand:hover img,
.navbar-brand:hover .navbar-logo {
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
}

/* Logo più piccolo su mobile */
@media (max-width: 768px) {
    .navbar-brand img,
    .navbar-logo {
        height: 40px;
    }
}

.nav-link {
    transition: all 0.3s ease;
    border-radius: 5px;
    margin: 0 5px;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* Pulsante Accedi visibile su mobile e desktop */
.btn-accent-mobile {
    background-color: var(--accent-color) !important;
    color: #000 !important;
    font-weight: 600;
    border-radius: 8px;
    padding: 0.5rem 1rem;
}

.btn-accent-mobile:hover {
    background-color: #8fe600 !important;
    color: #000 !important;
    transform: translateY(-2px);
}

/* Desktop: margine sinistro per separare */
@media (min-width: 992px) {
    .btn-accent-mobile {
        margin-left: 0.5rem;
    }
}

/* Mobile: allineamento a sinistra e dimensione contenuta */
@media (max-width: 991px) {
    .navbar-nav {
        text-align: left !important;
    }
    
    .nav-link {
        text-align: left !important;
        padding: 0.75rem 1rem;
    }
    
    .btn-accent-mobile {
        width: auto;
        display: inline-block;
        text-align: center;
        margin-top: 0.5rem;
        padding: 0.75rem 2rem;
    }
}

/* ===== CARDS ===== */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15) !important;
}

/* ===== CARDS TORNEI SPECIFICHE ===== */
.torneo-card {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.torneo-card .card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    padding: 1rem;
}

.torneo-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0;
}

.torneo-card:hover {
    border-color: var(--primary-color);
}

.torneo-card .card-footer {
    border-top: 1px solid #e0e0e0;
}

/* ===== BUTTONS ===== */
.btn {
    transition: all 0.3s ease;
    border-radius: 8px;
    font-weight: 500;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* ===== HERO SECTION ===== */
.bg-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%) !important;
}

.rounded-3 {
    border-radius: 15px !important;
}

/* ===== BADGES ===== */
.badge {
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
}

/* ===== FORM CONTROLS ===== */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 212, 255, 0.15);
}

/* ===== FOOTER ===== */
footer {
    margin-top: auto; /* Footer sempre in fondo */
    background-color: #212529; /* Sfondo scuro */
}

footer a:hover {
    text-decoration: underline !important;
}

/* Logo nel footer */
.footer-logo {
    height: 40px;
    filter: drop-shadow(0 2px 6px rgba(255, 255, 255, 0.2));
    transition: filter 0.3s ease;
}

.footer-logo:hover {
    filter: drop-shadow(0 2px 8px rgba(255, 255, 255, 0.4));
}

/* Mobile: logo footer più piccolo */
@media (max-width: 768px) {
    .footer-logo {
        height: 35px;
    }
}

/* ===== SPINNER ===== */
.spinner-border {
    width: 3rem;
    height: 3rem;
}

/* ===== ERROR UI ===== */
#blazor-error-ui {
    background: #dc3545;
    color: white;
    padding: 1rem;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

#blazor-error-ui .reload,
#blazor-error-ui .dismiss {
    color: white;
    margin-left: 1rem;
    cursor: pointer;
    text-decoration: underline;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .display-3 {
        font-size: 2.5rem !important;
    }
    
    .display-5 {
        font-size: 2rem !important;
    }
    
    .lead {
        font-size: 1rem !important;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .torneo-card .card-title {
        font-size: 1rem;
    }
}

/* ===== ANIMAZIONI ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card, .btn, .navbar {
    animation: fadeIn 0.5s ease-in-out;
}

/* ===== UTILITIES ===== */
.shadow-sm {
    box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075) !important;
}

.shadow {
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15) !important;
}

.shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, .175) !important;
}

/* ===== CLASSI COLORI CUSTOM (da Logo) ===== */
/* Colore Accent (Verde Lime) */
.text-accent {
    color: var(--accent-color) !important;
}

.bg-accent {
    background-color: var(--accent-color) !important;
}

.btn-accent {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #000;
    font-weight: 600;
}

.btn-accent:hover {
    background-color: #8fe600;
    border-color: #8fe600;
    color: #000;
}

.badge-accent {
    background-color: var(--accent-color);
    color: #000;
    font-weight: 600;
}

/* Colore Primary Dark */
.bg-primary-dark {
    background-color: var(--primary-dark) !important;
}

.text-primary-dark {
    color: var(--primary-dark) !important;
}

/* Bordi con colori custom */
.border-accent {
    border-color: var(--accent-color) !important;
}

.border-primary {
    border-color: var(--primary-color) !important;
}

/* Form validation styles */
h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}
