/**
 * Player Dashboard CSS
 * Design moderne inspiré du dashboard fourni avec couleurs Volitives
 */

/* Remove padding from admin container when dashboard is displayed */
/* .admin-section.active#player-dashboard-section {
    margin: -2rem !important;
}
 */
/* Alternative approach - target the admin container directly when dashboard section is active */
body:has(#player-dashboard-section.active) .admin-container {
    padding: 0rem !important;
}

/* ==========================================================================
   Variables CSS - Couleurs Volitives
   ========================================================================== */
:root {
    --primary-color: var(--colors--primary--100, #229396);
    --secondary-color: var(--colors--neutral--800, #271b3f);
    --neutral-100: var(--colors--neutral--100, white);
    --neutral-200: var(--colors--neutral--200, #e9f0f1);
    --neutral-300: var(--colors--neutral--300, #c3b6e2);
    --neutral-400: var(--colors--neutral--400, #304793);
    --neutral-500: var(--colors--neutral--500, #6e56a4);
    --neutral-800: var(--colors--neutral--800, #271b3f);
    
    /* Couleurs des widgets */
    --widget-purple: #8B5CF6;
    --widget-teal: #229396;
    --widget-orange: #F59E0B;
    --widget-blue: #3B82F6;
    --widget-green: #10B981;
    --widget-red: #EF4444;
    
    /* Variables de layout */
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --font-family: var(--font-family--primary-font, "Goli", "Outfit", Arial, sans-serif);
}

/* ==========================================================================
   Layout principal du dashboard
   ========================================================================== */
.dashboard-container {
    display: grid;
    grid-template-columns: 300px 1fr 280px;
    grid-template-rows: auto 1fr;
    gap: var(--spacing-lg);
    min-height: 100vh;
    background-color: #f8fafc;
    padding: var(--spacing-lg);
    font-family: var(--font-family);
}

.dashboard-header {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.dashboard-sidebar-left {
    grid-row: 2;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.dashboard-main {
    grid-row: 2;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.dashboard-sidebar-right {
    grid-row: 2;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* ==========================================================================
   Widgets statistiques
   ========================================================================== */
.stats-widget {
    background: var(--neutral-100);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    color: white;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stats-widget::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    opacity: 0.1;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.stats-widget.evaluation-score {
    background: #00023e;
}

.stats-widget.attendance-rate {
    background: #2563EB;
}

.stats-widget.jump-block {
    background: #2563EB;
}

.stats-widget.jump-attack {
    background: #2563EB;
}

.widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0rem;
    color: white !important;
}

.widget-icon {
    color: white !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.widget-title {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    margin: 0;
}

.widget-content {
    display: flex;
    align-items: right;
    justify-content: flex-end;
    text-align: right;
    gap: var(--spacing-sm);
}

.widget-value {
    font-size: 40px;
    font-weight: 600;
    line-height: 1;
}

.widget-unit {
    font-size: 14px;
    opacity: 0.8;
    font-weight: 500;
}

.widget-trend {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0.9;
}

.widget-progress {
    text-align: right;
    font-size: 14px;
    opacity: 0.8;
}

/* ==========================================================================
   Sidebar profil (gauche)
   ========================================================================== */
.profile-card {
    background: var(--neutral-100);
    border-radius: var(--border-radius);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-md);
    text-align: center;
    position: relative;
}

.profile-edit-btn {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}


.profile-edit-btn:active {
    transform: scale(0.95);
}

.profile-edit-btn svg {
    color: white;
    stroke: currentColor;
}

.profile-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto var(--spacing-md);
    background: var(--neutral-200);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar .avatar-placeholder {
    font-size: 32px;
    color: var(--neutral-400);
}

.profile-name {
    font-size: 20px;
    font-weight: 600;
    color: var(--secondary-color);
    margin: 0 0 var(--spacing-xs) 0;
}

.profile-role {
    font-size: 16px;
    color: var(--secondary-color);
    margin: 0 0 var(--spacing-md) 0;
}

.profile-contact {
    font-size: 14px;
    background: var(--secondary-color);
    color: white;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    margin: 0;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

.profile-stat {
    text-align: center;
    padding: var(--spacing-sm);
    background: var(--neutral-200);
    border-radius: var(--border-radius-sm);
}

.profile-stat-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--secondary-color);
}

.profile-stat-label {
    display: block;
    font-size: 12px;
    color: var(--neutral-500);
    margin-top: 4px;
}

.player-info-card {
    background: var(--neutral-100);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
}

.info-section {
    margin-bottom: var(--spacing-lg);
}

.info-section:last-child {
    margin-bottom: 0;
}

.info-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--secondary-color);
    margin: 0 0 var(--spacing-sm) 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-xs) 0;
    border-bottom: 1px solid var(--neutral-200);
}

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

.info-label {
    font-size: 14px;
    color: var(--neutral-500);
    font-weight: 500;
}

.info-value {
    font-size: 14px;
    color: var(--secondary-color);
    font-weight: 500;
}

/* ==========================================================================
   Section centrale - Tabs
   ========================================================================== */
.main-content {
    background: var(--neutral-100);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.content-tabs {
    display: flex;
    border-bottom: 1px solid var(--neutral-200);
    background: var(--neutral-100);
}

.tab-button {
    flex: 1;
    padding: var(--spacing-md) var(--spacing-lg);
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--neutral-500);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.tab-button:hover {
    color: var(--secondary-color);
    background: var(--neutral-200);
}

.tab-button.active {
    color: var(--primary-color);
    background: var(--neutral-100);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.tab-content {
    padding: var(--spacing-xl);
    min-height: 400px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* Chart container */
.chart-container {
    position: relative;
    height: 300px;
    margin: var(--spacing-lg) 0;
}

/* Lists in tabs */
.data-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-sm);
    background: var(--neutral-200);
    border-radius: var(--border-radius-sm);
    transition: background-color 0.2s ease;
}

.list-item:hover {
    background: var(--neutral-300);
}

.list-item-content {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.list-item-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 12px;
}

.list-item-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--secondary-color);
    margin: 0;
}

.list-item-info p {
    font-size: 12px;
    color: var(--neutral-500);
    margin: 2px 0 0;
}

.list-item-meta {
    text-align: right;
    font-size: 12px;
    color: var(--neutral-500);
}

/* Status badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.active {
    background: var(--widget-red);
    color: white;
}

.status-badge.recovering {
    background: var(--widget-orange);
    color: white;
}

.status-badge.recovered {
    background: var(--widget-green);
    color: white;
}

.status-badge.minor {
    background: var(--widget-green);
    color: white;
}

.status-badge.moderate {
    background: var(--widget-orange);
    color: white;
}

.status-badge.severe {
    background: var(--widget-red);
    color: white;
}

/* ==========================================================================
   Sidebar calendrier (droite)
   ========================================================================== */
.calendar-card {
    background: var(--neutral-100);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
}

.calendar-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--secondary-color);
    margin: 0 0 var(--spacing-sm) 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-nav {
    display: flex;
    gap: var(--spacing-xs);
}

.nav-button {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--neutral-200);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--neutral-500);
    transition: all 0.2s ease;
}

.nav-button:hover {
    background: var(--primary-color);
    color: white;
}

.events-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-height: 400px;
    overflow-y: auto;
}

.event-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius-sm);
    transition: background-color 0.2s ease;
}

.event-item:hover {
    background: var(--neutral-200);
}

.event-time {
    width: 50px;
    text-align: center;
    font-size: 13px;
    color: var(--neutral-500);
    font-weight: 500;
}

.event-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.event-indicator.training {
    background: var(--widget-teal);
}

.event-indicator.match {
    background: var(--widget-red);
}

.event-indicator.tournament {
    background: var(--widget-orange);
}

.event-indicator.meeting {
    background: var(--widget-purple);
}

.event-indicator.social {
    background: var(--widget-green);
}

.event-indicator.other {
    background: var(--neutral-400);
}

.event-details h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--secondary-color);
    margin: 0;
}

.event-details p {
    font-size: 13px;
    color: var(--neutral-500);
    margin: 2px 0 0;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Tablet */
@media (max-width: 1024px) {
    .dashboard-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
        gap: var(--spacing-md);
        padding: var(--spacing-md);
    }
    
    .dashboard-header {
        grid-column: 1;
        grid-row: 1;
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-sidebar-left {
        grid-column: 1;
        grid-row: 2;
    }
    
    .dashboard-main {
        grid-column: 1;
        grid-row: 3;
    }
    
    .dashboard-sidebar-right {
        grid-column: 1;
        grid-row: 4;
    }
    
    .content-tabs {
        overflow-x: auto;
    }
    
    .tab-button {
        white-space: nowrap;
        min-width: 120px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .dashboard-container {
        padding: var(--spacing-sm);
        gap: var(--spacing-sm);
    }
    
    .dashboard-header {
        grid-template-columns: 1fr;
    }
    
    .stats-widget {
        padding: var(--spacing-md);
        min-height: 100px;
    }
    
    .widget-value {
        font-size: 24px;
    }
    
    .profile-card {
        padding: var(--spacing-md);
    }
    
    .profile-avatar {
        width: 60px;
        height: 60px;
    }
    
    .profile-stats {
        grid-template-columns: 1fr;
    }
    
    .tab-content {
        padding: var(--spacing-md);
    }
    
    .calendar-card {
        padding: var(--spacing-md);
    }
    
    .events-list {
        max-height: 300px;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .dashboard-header {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .widget-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs);
    }
    
    .list-item-meta {
        text-align: left;
        width: 100%;
    }
}

/* ==========================================================================
   Animations et transitions
   ========================================================================== */
.dashboard-container * {
    transition: all 0.2s ease;
}

.stats-widget:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.profile-card:hover,
.player-info-card:hover,
.main-content:hover,
.calendar-card:hover {
    box-shadow: var(--shadow-lg);
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Print styles
   ========================================================================== */
@media print {
    .dashboard-container {
        display: block;
        background: white;
        padding: 0;
    }
    
    .stats-widget,
    .profile-card,
    .player-info-card,
    .main-content,
    .calendar-card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
        margin-bottom: 20px;
    }
    
    .content-tabs,
    .calendar-nav,
    .widget-menu {
        display: none;
    }
    
    .tab-pane {
        display: block !important;
    }
}