/**
 * =====================================================
 * SHOOTERSARENA - ADMIN/GESTORE DASHBOARD STYLES
 * =====================================================
 */

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background: linear-gradient(135deg, #0a1628 0%, #1a2a4a 50%, #0d1f3c 100%);
    min-height: 100vh;
    color: #e0e0e0;
    line-height: 1.6;
}

/* ===== HEADER ===== */
.admin-header {
    background: rgba(10, 22, 40, 0.95);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(0, 212, 255, 0.3);
    backdrop-filter: blur(10px);
}

.admin-header.gestore {
    border-bottom-color: rgba(255, 107, 53, 0.3);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    width: 40px;
    height: 40px;
}

.header-left h1 {
    font-size: 24px;
    font-weight: 700;
    color: #00d4ff;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.role-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.role-badge.admin {
    background: linear-gradient(135deg, #00d4ff, #0099cc);
    color: #000;
}

.role-badge.gestore {
    background: linear-gradient(135deg, #ff6b35, #ff8c5a);
    color: #fff;
}

.role-badge.atleta,
.role-badge.capitano,
.role-badge.vice_capitano {
    background: rgba(100, 150, 255, 0.2);
    color: #aaa;
}

.role-badge.capitano {
    background: rgba(255, 215, 0, 0.3);
    color: #ffd700;
}

.role-badge.vice_capitano {
    background: rgba(192, 192, 192, 0.3);
    color: #c0c0c0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    color: #aaa;
    font-weight: 600;
}

.btn-logout {
    padding: 8px 20px;
    background: rgba(255, 50, 50, 0.2);
    border: 1px solid rgba(255, 50, 50, 0.5);
    border-radius: 8px;
    color: #ff6b6b;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Rajdhani', sans-serif;
}

.btn-logout:hover {
    background: rgba(255, 50, 50, 0.4);
    transform: translateY(-2px);
}

/* ===== NAVIGATION ===== */
.admin-nav {
    background: rgba(20, 35, 60, 0.8);
    padding: 10px 30px;
    display: flex;
    gap: 10px;
    border-bottom: 1px solid rgba(100, 150, 255, 0.1);
    flex-wrap: wrap;
}

.nav-tab {
    padding: 10px 25px;
    background: transparent;
    border: none;
    color: #888;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    font-family: 'Rajdhani', sans-serif;
}

.nav-tab:hover {
    background: rgba(100, 150, 255, 0.1);
    color: #00d4ff;
}

.nav-tab.active {
    background: rgba(0, 212, 255, 0.2);
    color: #00d4ff;
    border: 1px solid rgba(0, 212, 255, 0.3);
}

/* ===== MAIN CONTENT ===== */
.admin-main {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.section-header h2 {
    color: #00d4ff;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 0;
}

h2 {
    color: #00d4ff;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 25px;
}

h3 {
    color: #ff6b35;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: rgba(20, 35, 60, 0.8);
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    border: 1px solid rgba(100, 150, 255, 0.1);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.1);
}

.stat-card.wide {
    grid-column: span 2;
}

.stat-card.highlight {
    border-color: rgba(255, 107, 53, 0.3);
}

.stat-card.highlight:hover {
    border-color: rgba(255, 107, 53, 0.5);
    box-shadow: 0 10px 30px rgba(255, 107, 53, 0.1);
}

.stat-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: #00d4ff;
    margin-bottom: 5px;
}

.stat-card.highlight .stat-value {
    color: #ff6b35;
}

.stat-label {
    font-size: 14px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== BUTTONS ===== */
.btn-primary {
    padding: 12px 25px;
    background: linear-gradient(135deg, #ff6b35 0%, #ff8c5a 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Rajdhani', sans-serif;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
}

.btn-secondary {
    padding: 12px 25px;
    background: rgba(100, 150, 255, 0.1);
    border: 1px solid rgba(100, 150, 255, 0.3);
    border-radius: 10px;
    color: #aaa;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Rajdhani', sans-serif;
}

.btn-secondary:hover {
    background: rgba(100, 150, 255, 0.2);
    color: #fff;
}

.btn-small {
    padding: 8px 16px;
    background: rgba(0, 212, 255, 0.2);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    color: #00d4ff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Rajdhani', sans-serif;
}

.btn-small:hover {
    background: rgba(0, 212, 255, 0.4);
}

.btn-action {
    padding: 6px 10px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.btn-action:hover {
    background: rgba(100, 150, 255, 0.2);
    transform: scale(1.1);
}

.btn-action.edit:hover {
    background: rgba(0, 212, 255, 0.2);
}

.btn-action.disable:hover {
    background: rgba(255, 50, 50, 0.2);
}

.btn-action.enable:hover {
    background: rgba(50, 255, 50, 0.2);
}

.btn-action.remove:hover {
    background: rgba(255, 50, 50, 0.3);
}

/* ===== TABLES ===== */
.table-container {
    background: rgba(20, 35, 60, 0.6);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid rgba(100, 150, 255, 0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: rgba(0, 212, 255, 0.1);
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: 700;
    color: #00d4ff;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
    border-bottom: 2px solid rgba(0, 212, 255, 0.2);
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(100, 150, 255, 0.1);
    vertical-align: middle;
}

.data-table tbody tr:hover {
    background: rgba(100, 150, 255, 0.05);
}

.data-table td.loading,
.data-table td.empty,
.data-table td.error {
    text-align: center;
    padding: 30px;
    color: #666;
    font-style: italic;
}

.data-table td.error {
    color: #ff6b6b;
}

.data-table td.details {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #888;
    font-size: 13px;
}

/* ===== STATUS BADGES ===== */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-badge.active {
    background: rgba(50, 255, 50, 0.2);
    color: #6bff6b;
}

.status-badge.inactive {
    background: rgba(255, 50, 50, 0.2);
    color: #ff6b6b;
}

/* ===== MODALS ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: rgba(20, 35, 60, 0.98);
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(0, 212, 255, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-content.large {
    max-width: 800px;
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid rgba(100, 150, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #00d4ff;
    font-size: 22px;
    margin-bottom: 0;
}

.modal-close {
    background: none;
    border: none;
    color: #888;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: #ff6b6b;
}

.modal-body {
    padding: 25px;
}

form {
    padding: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #aaa;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid rgba(100, 150, 255, 0.2);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 15px;
    font-family: 'Rajdhani', sans-serif;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}

.form-group input[type="color"] {
    padding: 5px;
    height: 45px;
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: #666;
    font-size: 12px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid rgba(100, 150, 255, 0.1);
}

.membri-actions {
    margin-bottom: 20px;
}

/* ===== SQUADRE GRID ===== */
.squadre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.squadra-card {
    background: rgba(20, 35, 60, 0.8);
    border-radius: 15px;
    border: 1px solid rgba(100, 150, 255, 0.1);
    border-left: 4px solid #007bff;
    overflow: hidden;
    transition: all 0.3s ease;
}

.squadra-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.squadra-header {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.squadra-header h4 {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}

.squadra-badge {
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.squadra-badge.active {
    background: rgba(50, 255, 50, 0.2);
    color: #6bff6b;
}

.squadra-badge.inactive {
    background: rgba(255, 50, 50, 0.2);
    color: #ff6b6b;
}

.squadra-body {
    padding: 20px;
}

.squadra-desc {
    color: #888;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.5;
}

.squadra-stats {
    color: #aaa;
    font-size: 14px;
}

.squadra-stats strong {
    color: #00d4ff;
}

.squadra-actions {
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.1);
    border-top: 1px solid rgba(100, 150, 255, 0.1);
}

/* ===== QUICK ACTIONS ===== */
.quick-actions {
    margin-top: 30px;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.action-btn {
    background: rgba(20, 35, 60, 0.8);
    border: 1px solid rgba(100, 150, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Rajdhani', sans-serif;
}

.action-btn:hover {
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.3);
    transform: translateY(-3px);
}

.action-icon {
    font-size: 32px;
}

.action-text {
    color: #aaa;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== STATS SECTIONS ===== */
.stats-section {
    margin-bottom: 40px;
}

/* ===== EMPTY & LOADING STATES ===== */
.loading-placeholder,
.error-placeholder {
    padding: 40px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.error-placeholder {
    color: #ff6b6b;
}

.empty-state {
    padding: 60px 40px;
    text-align: center;
    color: #666;
}

.empty-state p {
    margin-bottom: 20px;
    font-size: 18px;
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 15px 25px;
    border-radius: 10px;
    color: #fff;
    font-weight: 600;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    max-width: 400px;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background: rgba(50, 200, 50, 0.9);
}

.toast.error {
    background: rgba(200, 50, 50, 0.9);
}

.toast.warning {
    background: rgba(200, 150, 50, 0.9);
}

.toast.info {
    background: rgba(50, 150, 200, 0.9);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .header-left h1 {
        font-size: 20px;
    }

    .admin-nav {
        padding: 10px 15px;
        overflow-x: auto;
    }

    .nav-tab {
        padding: 8px 15px;
        font-size: 14px;
        white-space: nowrap;
    }

    .admin-main {
        padding: 15px;
    }

    .section-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .stat-card.wide {
        grid-column: span 2;
    }

    .table-container {
        overflow-x: auto;
    }

    .data-table {
        min-width: 600px;
    }

    .modal-content {
        max-height: 95vh;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .squadre-grid {
        grid-template-columns: 1fr;
    }

    .toast-container {
        right: 10px;
        left: 10px;
    }

    .toast {
        max-width: none;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card.wide {
        grid-column: span 1;
    }

    h2 {
        font-size: 24px;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }

    .form-actions {
        flex-direction: column;
    }
}