/**
 * Webisport Dashboard Base Styles
 * 
 * This file contains:
 * - CSS Variables (design tokens)
 * - Dashboard layout structure
 * - Sidebar navigation
 * - Main content area
 * - Responsive base styles
 */

/* ================================================
   CSS Variables - Design Tokens
   ================================================ */

.webisport-dashboard {
    /* Primary Colors (overridden at runtime from parametres-club couleur_2/3) */
    --ws-primary: #7367f0;
    --ws-primary-dark: #685dd8;
    --ws-primary-light: #8f84f4;
    /* Readable text/icon tint when brand primary is too light on white. */
    --ws-primary-ink: var(--ws-primary);
    /* Accent borders/outlines on white surfaces (matches ink when brand is light). */
    --ws-primary-border: var(--ws-primary-ink);
    --ws-on-primary: #ffffff;
    --ws-primary-rgb: 115, 103, 240;
    --ws-primary-ink-rgb: var(--ws-primary-rgb);
    --ws-primary-border-rgb: var(--ws-primary-ink-rgb);
    --ws-primary-border-soft: rgba(var(--ws-primary-border-rgb), 0.22);
    --ws-primary-soft: var(--ws-primary-alpha-16);
    --webisport-primary: var(--ws-primary);
    --ws-primary-alpha-16: rgba(var(--ws-primary-rgb), 0.16);
    --ws-primary-shadow: rgba(var(--ws-primary-rgb), 0.3);
    --ws-primary-shadow-md: rgba(var(--ws-primary-rgb), 0.35);

    /* Sidebar shell (overridden from parametres-club couleur_1) */
    --ws-sidebar-bg: #2f3349;
    --ws-sidebar-hover: #3a3d53;
    --ws-sidebar-rgb: 47, 51, 73;
    --ws-sidebar-text: #cfcde4;
    --ws-sidebar-text-muted: #676e98;
    --ws-sidebar-text-subtle: #76778e;

    /* Semantic Colors */
    --ws-success: #28c76f;
    --ws-success-light: rgba(40, 199, 111, 0.16);
    --ws-success-dark: #1f9b56;
    --ws-warning: #ff9f43;
    --ws-warning-light: rgba(255, 159, 67, 0.16);
    --ws-warning-dark: #d97706;
    --ws-danger: #ff4c51;
    --ws-danger-light: rgba(255, 76, 81, 0.16);
    --ws-danger-dark: #e6353b;
    --ws-info: #00bad1;
    --ws-info-light: rgba(0, 186, 209, 0.16);
    --ws-info-dark: #0097aa;

    /* Neutral Colors */
    --ws-white: #ffffff;
    --ws-gray-50: #f8f7fa;
    --ws-gray-100: #f3f2f3;
    --ws-gray-200: #e6e4e8;
    --ws-gray-300: #d7d5dd;
    --ws-gray-400: #b7b5be;
    --ws-gray-500: #97959e;
    --ws-gray-600: #6d6b77;
    --ws-gray-700: #5d596c;
    --ws-gray-800: #444050;
    --ws-gray-900: #2f2b3d;

    /* Semantic Aliases */
    --ws-bg: var(--ws-gray-50);
    --ws-bg-light: var(--ws-white);
    --ws-bg-subtle: #f8f8f9;
    --ws-border: var(--ws-gray-200);
    --ws-border-light: rgba(47, 43, 61, 0.12);
    --ws-text: var(--ws-gray-900);
    --ws-text-secondary: var(--ws-gray-600);
    --ws-text-muted: var(--ws-gray-500);
    --ws-text-light: var(--ws-gray-400);

    /* Layout */
    --ws-sidebar-width: 260px;
    --ws-sidebar-width-collapsed: 4.5rem;
    --ws-header-height: 64px;

    /* Spacing */
    --ws-space-1: 0.25rem;
    --ws-space-2: 0.5rem;
    --ws-space-3: 0.75rem;
    --ws-space-4: 1rem;
    --ws-space-5: 1.25rem;
    --ws-space-6: 1.5rem;
    --ws-space-8: 2rem;

    /* Border Radius */
    --ws-radius-sm: 0.25rem;
    --ws-radius: 0.375rem;
    --ws-radius-lg: 0.5rem;
    --ws-radius-full: 9999px;

    /* Shadows */
    --ws-shadow-sm: 0 0.125rem 0.5rem 0 rgba(47, 43, 61, 0.12);
    --ws-shadow: 0 0.1875rem 0.75rem 0 rgba(47, 43, 61, 0.14);
    --ws-shadow-md: 0 0.25rem 1.125rem 0 rgba(47, 43, 61, 0.2);
    --ws-shadow-lg: 0 0.375rem 1.5rem 0 rgba(47, 43, 61, 0.24);

    /* Transitions */
    --ws-transition-fast: 0.15s ease;
    --ws-transition: 0.2s ease;
    --ws-transition-slow: 0.3s ease;

    /* ─── Alias tokens ──────────────────────────────────────────────────────
       These fill gaps that code throughout the dashboard references but that
       the original token list did not include.  Defining them here as aliases
       means every file that already uses them starts working without needing
       individual search-and-replace.
       ────────────────────────────────────────────────────────────────────── */

    /* Surface aliases (white card surface vs. slightly-off-white secondary) */
    --ws-surface:           var(--ws-bg-light);    /* #ffffff */
    --ws-surface-secondary: var(--ws-gray-100);    /* #f3f2f3 */

    /* Text alias used in non-secondary contexts */
    --ws-text-primary: var(--ws-text);             /* #2f2b3d */

    /* Border-radius alias (sits between --ws-radius and --ws-radius-lg) */
    --ws-radius-md: var(--ws-radius-lg);           /* 0.5rem */

    /* Typography scale (matches the 15px dashboard body) */
    --ws-text-xs:   0.75rem;     /*  12px */
    --ws-text-sm:   0.8125rem;   /*  13px */
    --ws-text-base: 0.9375rem;   /*  15px */
    --ws-text-lg:   1.0625rem;   /*  17px */
    --ws-text-xl:   1.125rem;    /*  18px */
}

/* ================================================
   Dashboard Layout
   ================================================ */

.webisport-dashboard {
    display: flex;
    min-height: 100vh;
    background: var(--ws-bg);
    font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--ws-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ================================================
   Scoped CSS Isolation
   Resets HTML elements within the dashboard so that
   WordPress / Elementor / theme styles do not bleed
   into our component classes.

   NOTE: These use element-type selectors (0-1-1 specificity).
   All component rules in components.css are prefixed with
   .webisport-dashboard to achieve 0-2-0 specificity and win.
   ================================================ */

/* Box-sizing for every element inside the dashboard */
.webisport-dashboard *,
.webisport-dashboard *::before,
.webisport-dashboard *::after {
    box-sizing: border-box;
}

/* Headings — prevent theme font-sizes and margins from leaking */
.webisport-dashboard h1,
.webisport-dashboard h2,
.webisport-dashboard h3,
.webisport-dashboard h4,
.webisport-dashboard h5,
.webisport-dashboard h6 {
    font-family: inherit;
    font-weight: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    margin: 0;
    padding: 0;
}

/* Paragraphs */
.webisport-dashboard p {
    margin: 0;
    padding: 0;
}

/* Links — prevent Elementor / theme colors and underlines */
.webisport-dashboard a {
    color: inherit;
    text-decoration: none;
    background-color: transparent;
}

/* Lists — strip bullets and indentation */
.webisport-dashboard ul,
.webisport-dashboard ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

.webisport-dashboard li {
    margin: 0;
    padding: 0;
}

/* Buttons — full reset so that WP/theme rules (e.g. `.page button`,
   `.entry-content button`, `.site-main button`) cannot bleed in regardless
   of cascade order.  All .webisport-btn-* variants explicitly re-declare
   their own background, color, and border, so these defaults are never
   visible on styled buttons. */
.webisport-dashboard button,
.webisport-dashboard input[type="button"],
.webisport-dashboard input[type="submit"],
.webisport-dashboard input[type="reset"] {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    background: transparent;
    background-image: none;
    border: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
    text-shadow: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    outline: revert; /* keep browser focus ring accessible */
}

/* Inputs, selects, textareas — strip browser / theme layout noise.
   color/background are set to safe neutral defaults so WP or theme rules
   that fire after ours (e.g. `.page input { color: white; }`) cannot bleed
   in via cascade-order.  All .webisport-input / .webisport-select rules at
   specificity 0-2-0 re-declare their own explicit values. */
.webisport-dashboard input,
.webisport-dashboard select,
.webisport-dashboard textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    background-color: transparent;
    box-sizing: border-box;
}

/* Images */
.webisport-dashboard img {
    max-width: 100%;
    height: auto;
    border: none;
    vertical-align: middle;
}

/* Tables */
.webisport-dashboard table {
    border-collapse: separate;
    border-spacing: 0;
}

.webisport-dashboard th,
.webisport-dashboard td {
    font-weight: inherit;
}

/* ================================================
   Sidebar (Dark theme — Vuexy pattern)
   ================================================ */

.webisport-dashboard .webisport-dashboard-sidebar {
    width: var(--ws-sidebar-width);
    background: var(--ws-sidebar-bg);
    box-shadow: 0 0.125rem 0.5rem 0 rgba(19, 17, 32, 0.18);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    z-index: 100;
    transition: width var(--ws-transition-slow);
}

.webisport-dashboard.is-sidebar-collapsed .webisport-dashboard-sidebar {
    width: var(--ws-sidebar-width-collapsed);
}

.webisport-dashboard.is-sidebar-collapsed .webisport-nav-group-label,
.webisport-dashboard.is-sidebar-collapsed .webisport-nav-item > span,
.webisport-dashboard.is-sidebar-collapsed .webisport-user-info {
    display: none;
}

.webisport-dashboard.is-sidebar-collapsed .webisport-dashboard-logo {
    flex-direction: column;
    align-items: center;
    gap: var(--ws-space-3);
    padding: var(--ws-space-5) var(--ws-space-3);
}

.webisport-dashboard.is-sidebar-collapsed .webisport-dashboard-logo-brand {
    justify-content: center;
}

.webisport-dashboard.is-sidebar-collapsed .webisport-nav-item {
    justify-content: center;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.webisport-dashboard .webisport-dashboard-logo {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--ws-space-2);
    flex-shrink: 0;
    padding: var(--ws-space-5) var(--ws-space-4) var(--ws-space-4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--ws-sidebar-text);
}

.webisport-dashboard .webisport-dashboard-logo-brand {
    display: flex;
    align-items: center;
    gap: var(--ws-space-3);
    min-width: 0;
}

.webisport-dashboard .webisport-sidebar-user-avatar {
    flex-shrink: 0;
    display: block;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--ws-radius-full);
}

.webisport-dashboard .webisport-sidebar-collapse {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: var(--ws-radius);
    background: transparent;
    color: var(--ws-sidebar-text-subtle);
    cursor: pointer;
    transition: background var(--ws-transition), color var(--ws-transition);
}

.webisport-dashboard .webisport-sidebar-collapse:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--ws-sidebar-text);
}

.webisport-dashboard .webisport-sidebar-collapse:focus-visible {
    outline: 2px solid rgba(var(--ws-primary-rgb), 0.65);
    outline-offset: 2px;
}

.webisport-dashboard .webisport-sidebar-collapse .webisport-nav-icon {
    flex-shrink: 0;
    width: 1.125rem;
    height: 1.125rem;
    font-size: 1.125rem;
}

.webisport-dashboard .webisport-dashboard-nav {
    flex: 1 1 auto;
    min-height: 0;
    padding: var(--ws-space-2) 0 var(--ws-space-6);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.webisport-dashboard .webisport-nav-group-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ws-sidebar-text-muted);
    padding: 0.875rem 1.5rem 0.25rem;
    margin-top: 0.25rem;
}

.webisport-dashboard .webisport-nav-item {
    display: flex;
    align-items: center;
    gap: var(--ws-space-2);
    padding: 0.5rem 0.75rem;
    margin: 0.125rem 0.75rem;
    border-radius: var(--ws-radius);
    color: var(--ws-sidebar-text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    transition: all var(--ws-transition);
}

.webisport-dashboard .webisport-nav-item--disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.webisport-dashboard .webisport-nav-item:hover {
    background: var(--ws-sidebar-hover);
    color: var(--ws-sidebar-text);
}

.webisport-dashboard .webisport-nav-item.active {
    background: linear-gradient(270deg, rgba(var(--ws-primary-rgb), 0.7) 0%, var(--ws-primary) 100%);
    color: var(--ws-on-primary);
    box-shadow: 0 0.125rem 0.375rem 0 var(--ws-primary-shadow);
}

.webisport-dashboard .webisport-nav-item .webisport-nav-icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    font-size: 1.25rem;
}

.webisport-dashboard .webisport-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.webisport-dashboard .webisport-user-name {
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--ws-sidebar-text);
}

.webisport-dashboard .webisport-logout {
    font-size: 12px;
    color: var(--ws-sidebar-text-subtle);
    text-decoration: none;
    transition: color var(--ws-transition);
}

.webisport-dashboard .webisport-logout:hover {
    color: var(--ws-danger);
}

/* ================================================
   Main Content
   ================================================ */

.webisport-dashboard .webisport-dashboard-main {
    flex: 1;
    /* Allow this flex item to shrink below its content width so inner
       .webisport-table-wrapper elements can scroll horizontally instead of
       widening the whole page. */
    min-width: 0;
    margin-left: var(--ws-sidebar-width);
    padding: 1.5rem;
    min-height: 100vh;
    background: var(--ws-bg);
    transition: margin-left var(--ws-transition-slow);
}

.webisport-dashboard.is-sidebar-collapsed .webisport-dashboard-main {
    margin-left: var(--ws-sidebar-width-collapsed);
}

/* ================================================
   Messages (login/access denied)
   ================================================ */

.webisport-dashboard.webisport-dashboard--gate {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: min(100vh, 720px);
    padding: var(--ws-space-8) var(--ws-space-4);
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, var(--ws-primary-alpha-16), transparent 70%),
        var(--ws-bg);
}

.webisport-dashboard .webisport-dashboard-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 28rem;
    text-align: center;
    padding: var(--ws-space-8) var(--ws-space-6);
    background: var(--ws-bg-light);
    border: 1px solid var(--ws-border-light);
    border-radius: var(--ws-radius-lg);
    box-shadow: var(--ws-shadow-md);
}

.webisport-dashboard .webisport-gate-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--ws-space-3);
    margin-bottom: var(--ws-space-6);
}

.webisport-dashboard .webisport-gate-brand-logo {
    width: 3rem;
    height: 3rem;
    object-fit: contain;
    border-radius: var(--ws-radius);
}

.webisport-dashboard .webisport-gate-brand-label {
    font-size: var(--ws-text-sm);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ws-text-muted);
}

.webisport-dashboard .webisport-message-icon {
    width: 4.5rem;
    height: 4.5rem;
    background: var(--ws-primary-alpha-16);
    border-radius: var(--ws-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--ws-space-5);
}

.webisport-dashboard .webisport-message-icon .dashicons,
.webisport-dashboard .webisport-message-icon .webisport-nav-icon {
    font-size: 1.75rem;
    width: 1.75rem;
    height: 1.75rem;
    color: var(--ws-primary-ink);
}

.webisport-dashboard .webisport-dashboard-message h2 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--ws-text);
    margin: 0 0 var(--ws-space-3);
    line-height: 1.3;
}

.webisport-dashboard .webisport-dashboard-message p {
    color: var(--ws-text-secondary);
    margin: 0;
    max-width: 22rem;
    line-height: 1.55;
}

.webisport-dashboard .webisport-gate-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--ws-space-3);
    margin-top: var(--ws-space-6);
}

/* ================================================
   Coming Soon Section
   ================================================ */

.webisport-dashboard .webisport-coming-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    text-align: center;
    padding: 3rem 2rem;
    background: var(--ws-bg-light);
    border-radius: var(--ws-radius-lg);
    box-shadow: var(--ws-shadow);
    margin-top: 1.5rem;
}

.webisport-dashboard .webisport-coming-soon__icon {
    width: 72px;
    height: 72px;
    border-radius: var(--ws-radius-full);
    background: rgba(var(--ws-primary-rgb), 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.webisport-dashboard .webisport-coming-soon__icon .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: var(--ws-primary-ink);
}

.webisport-dashboard .webisport-coming-soon__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ws-heading);
    margin: 0 0 0.5rem;
}

.webisport-dashboard .webisport-coming-soon__text {
    color: var(--ws-text-muted);
    font-size: 0.9375rem;
    margin: 0;
}

/* ================================================
   Responsive - Mobile
   ================================================ */

@media (max-width: 768px) {
    .webisport-dashboard .webisport-sidebar-collapse {
        display: none;
    }

    .webisport-dashboard .webisport-dashboard-sidebar {
        transform: translateX(-100%);
        transition: transform var(--ws-transition-slow);
    }

    .webisport-dashboard.is-sidebar-collapsed .webisport-dashboard-sidebar {
        width: var(--ws-sidebar-width);
    }

    .webisport-dashboard.is-sidebar-collapsed .webisport-dashboard-main {
        margin-left: 0;
    }

    .webisport-dashboard .webisport-dashboard-sidebar.open {
        transform: translateX(0);
    }

    .webisport-dashboard .webisport-dashboard-main {
        margin-left: 0;
        padding: var(--ws-space-4);
    }
}
/* Count next to a menu entry (pending reports). */
.webisport-dashboard .webisport-nav-badge {
    margin-left: auto;
    min-width: 1.25rem;
    padding: 0 0.375rem;
    border-radius: 999px;
    background: var(--ws-danger, #ea5455);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25rem;
    text-align: center;
}
