/* Font Import */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4F46E5;
    --primary-light: #818CF8;
    --secondary-color: #10B981;
    --dark-bg: #F3F4F6;
    --white: #FFFFFF;
    --text-dark: #1F2937;
    --text-muted: #6B7280;
    --shadow-soft: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-xl: 20px;
    --radius-lg: 12px;
}

body {
    background-color: #E5E7EB;
    /* Sfondo desktop grigio */
    font-family: 'Poppins', sans-serif;
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Mobile Container - Il "Telefono" virtuale */
.app-container {
    background-color: var(--white);
    width: 100%;
    max-width: 480px;
    /* Larghezza massima smartphone */
    min-height: 100vh;
    height: 100%;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow-x: hidden;
    padding-bottom: 80px;
    /* Spazio per la bottom bar */
    display: flex;
    flex-direction: column;
}

@media (max-width: 480px) {
    body {
        background-color: var(--white);
        align-items: flex-start;
    }

    .app-container {
        box-shadow: none;
        min-height: 100vh;
    }
}

/* Header */
.app-header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    padding: 30px 20px 20px;
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
    box-shadow: 0 4px 20px rgba(79, 70, 229, 0.3);
    margin-bottom: 20px;
}

.app-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.app-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Cards */
.custom-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(243, 244, 246, 0.8);
    transition: transform 0.2s;
}

.custom-card:active {
    transform: scale(0.98);
}

.card-icon {
    width: 50px;
    height: 50px;
    background: #EEF2FF;
    color: var(--primary-color);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.nome-torneo {
    text-transform: uppercase;
    font-size: 1.15rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-dark);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid #F3F4F6;
    display: flex;
    justify-content: space-around;
    padding: 15px 0 20px;
    /* Più padding sotto per i telefoni moderni */
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.05);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #9CA3AF;
    font-size: 0.75rem;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

/* Buttons */
.btn-primary-custom {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: var(--radius-lg);
    font-weight: 600;
    width: 100%;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    transition: all 0.3s;
}

.btn-primary-custom:hover {
    background-color: #4338CA;
    transform: translateY(-2px);
}

/* Floating Action Button */
.btn-fab {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 56px;
    height: 56px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.4);
    font-size: 1.5rem;
    z-index: 900;
    transition: transform 0.2s;
}

.btn-fab:active {
    transform: scale(0.9);
}

/* Ensure FAB stays within container on desktop */
@media (min-width: 481px) {
    .btn-fab {
        left: calc(50% + 240px - 76px);
        /* Center + half width - margin - button size */
        right: auto;
    }
}

/* Action Buttons in Card Footer */
.btn-action-fixed {
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Font size independent */
    font-size: 0.875rem;
}

.btn-action-icon {
    width: 36px;
    padding: 0;
    border-radius: 50% !important;
}

/* Custom overwrites for specific buttons if needed */
.btn-border-2 {
    border-width: 3px !important;
}

/* Custom Gray Toggle Button (No Border, Icon Only) */
.btn-gray-toggle {
    border: none !important;
    background-color: transparent !important;
    color: #343a40 !important;
    /* Dark Gray Icon */
    padding: 0 !important;
    width: 42px !important;
    height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: transform 0.2s;
    font-size: 1.5rem !important;
    /* Icone ben visibili */
    box-shadow: none !important;
}

.btn-gray-toggle:hover {
    background-color: transparent !important;
    color: #000000 !important;
    /* Slightly darker on hover */
    transform: scale(1.1);
    /* Subtle zoom effect instead of border */
}

/* Active State (Selected) */
.btn-gray-toggle.active {
    background-color: transparent !important;
    border: none !important;
    color: #343a40 !important;
    /* Keep Dark Gray (or change if user wants specific color) */
    box-shadow: none !important;
    outline: none !important;
}

/* Fix for icons inside */
.btn-gray-toggle i {
    /* Transition for smooth switching if needed */
}

/* Admin Restricted Nav Items (Gestione & Set) */
.nav-item-admin-restricted {
    opacity: 0.2;
    filter: grayscale(1);
    pointer-events: none;
    /* Disattivato di default su mobile */
    transition: all 0.3s ease;
}

.nav-item-admin-restricted i {
    color: var(--text-muted);
}

@media (min-width: 1024px) {
    .nav-item-admin-restricted {
        opacity: 1;
        filter: grayscale(0);
        pointer-events: auto;
        /* Riattvato su tablet landscape+ */
    }

    .nav-item-admin-restricted i.fa-cog {
        color: #4F46E5 !important;
    }

    .nav-item-admin-restricted i.fa-edit {
        color: var(--primary-color) !important;
    }

    .nav-item-admin-restricted:hover {
        transform: translateY(-2px);
    }
}