/**
 * Mon Petit Tartan - Responsive CSS
 * Winamax-style responsive - mobile first
 */

@media (max-width: 1200px) {
    .dashboard-stats { grid-template-columns: repeat(2, 1fr); }
    .profile-header { flex-direction: column; text-align: center; }
    .profile-stats { justify-content: center; }
}

@media (max-width: 992px) {
    :root { --sidebar-width: 240px; }
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-close { display: flex; }
    .main-content { margin-left: 0; }
    .menu-toggle { display: flex; }
    .mobile-nav { display: flex; }
    .page-content { padding-bottom: calc(var(--mobile-nav-height) + var(--spacing-lg)); }
    .col-md-6 { width: 50%; } .col-md-12 { width: 100%; }
    .welcome-banner { flex-direction: column; text-align: center; }
    .welcome-image { order: -1; }
}

@media (max-width: 768px) {
    :root { --topbar-height: 52px; }
    .topbar { padding: 0 var(--spacing-md); }
    .topbar-stats { display: none; }
    /* Stats cachées : c'est .topbar-actions qui doit pousser vers la droite. */
    .topbar-actions { margin-left: auto; }
    .page-content { padding: var(--spacing-md); }
    .dashboard-stats { grid-template-columns: repeat(2, 1fr); gap: var(--spacing-sm); }
    .athlete-grid { grid-template-columns: 1fr; }
    .league-grid { grid-template-columns: 1fr; }
    .market-filters { flex-direction: column; }
    .market-search { width: 100%; }
    .market-filter-group { overflow-x: auto; padding-bottom: var(--spacing-sm); -webkit-overflow-scrolling: touch; }
    .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table th, .table td { padding: 8px 10px; font-size: var(--font-size-sm); white-space: nowrap; }
    .ranking-item { flex-wrap: wrap; }
    .ranking-stats { width: 100%; justify-content: space-around; padding-top: var(--spacing-sm); border-top: 1px solid var(--border-color); margin-top: var(--spacing-sm); }
    .ranking-stat { text-align: center; }
    .auth-card { padding: var(--spacing-lg); }
    .auth-social { flex-direction: column; }
    .player-type-selector { flex-direction: column; }
    .col-sm-6 { width: 50%; } .col-sm-12 { width: 100%; }
}

@media (max-width: 480px) {
    :root { --font-size-3xl: 1.375rem; --font-size-4xl: 1.625rem; --spacing-xl: 1.5rem; --spacing-2xl: 2rem; }
    .logo-text { display: none; }
    .dashboard-stats { grid-template-columns: 1fr 1fr; }
    .stat-card { padding: var(--spacing-md); }
    .stat-card-value { font-size: var(--font-size-xl); }
    .page-title { font-size: var(--font-size-xl); }
    .section-header { flex-direction: column; align-items: flex-start; }
    .team-field { padding: var(--spacing-md); }
    .team-athlete-slot { margin: var(--spacing-xs); }
    .team-athlete-avatar { width: 46px; height: 46px; }
    .team-athlete-name { font-size: 9px; max-width: 55px; }
    .profile-avatar { width: 72px; height: 72px; }
    .profile-name { font-size: var(--font-size-xl); }
    .profile-stats { flex-direction: column; gap: var(--spacing-md); }
    .modal { width: 95%; max-height: 95vh; }
    .modal-body { max-height: calc(95vh - 140px); }
    .floating-alert { left: var(--spacing-md); right: var(--spacing-md); }
}

@media (max-width: 360px) {
    :root { font-size: 14px; }
    .mobile-nav-item span { font-size: 9px; }
    .mobile-nav-item i { font-size: 18px; }
}

@media (max-height: 500px) and (orientation: landscape) {
    .hero { min-height: auto; padding: var(--spacing-xl) 0; }
    .auth-page { min-height: auto; padding: var(--spacing-lg); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Force dark mode always */
@media (prefers-color-scheme: light) {
    :root:not([data-theme]) {
        --color-bg-primary: #0a0a0a;
        --color-bg-secondary: #141414;
        --color-bg-tertiary: #1e1e1e;
        --color-bg-card: #1a1a1a;
        --color-text-primary: #ffffff;
        --color-text-secondary: #a0a0a0;
        --color-text-muted: #666666;
        --border-color: rgba(255,255,255,0.08);
    }
}

@media print {
    .sidebar, .topbar, .mobile-nav, .btn, .action-btn { display: none !important; }
    .main-content { margin-left: 0 !important; }
    .page-content { padding: 0 !important; }
    body { background: white; color: black; }
    .card { border: 1px solid #ddd; box-shadow: none; }
}
