/* ========================================================================
 * neuronex.css — CSS global minimal du site
 *
 * Chargé par le nouveau _header.cfm (Phase 0+). Ce fichier ne contient que
 * le strictement global :
 *   - Import Google Font "Yusei Magic" (identité logo).
 *   - Variables de couleurs marque Neuronex.
 *   - Classes utilitaires génériques (pas liées à un composant).
 *
 * Le CSS par-composant va dans <style scoped> des fichiers .js de composants
 * Vue. Les tokens Web Awesome sont fournis par wa/styles/themes/default.css.
 * ==================================================================== */

/* ------------------------------------------------------------------------
 * Google Font : Yusei Magic (logo Neuronex)
 * ---------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Yusei+Magic&display=swap');

.neuronex-font {
    font-family: 'Yusei Magic', sans-serif;
    font-weight: normal;
    letter-spacing: 0.02em;
}

/* ------------------------------------------------------------------------
 * Variables de couleurs marque
 *
 * Les valeurs sont des placeholders à ajuster une fois que la palette
 * Web Awesome est installée. Garder les noms alignés sur les tokens WA
 * (voir wa/styles/themes/default.css pour la liste des custom properties
 * officiellement supportées).
 * ---------------------------------------------------------------------- */
:root {
    /* Identité Neuronex (à confirmer visuellement en Phase 1) */
    --neuronex-brand-primary: #3b82f6;
    --neuronex-brand-accent:  #8b5cf6;
    --neuronex-brand-surface: #0f172a;
    --neuronex-brand-text:    #e2e8f0;
}

/* ------------------------------------------------------------------------
 * Utilitaires globaux
 * ---------------------------------------------------------------------- */

/* Ancre écran-reader : pour les labels visuellement cachés mais lus à voix. */
.neuronex-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* === Phase 2 : Dashboard shell (minimaliste — raffiné Phase 3+) === */
.dashboard-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.dash-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 0.75rem 1.5rem;
    background: var(--neuronex-brand-surface, #0f172a);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.dash-nav .brand {
    font-size: 1.5rem;
    color: inherit;
    text-decoration: none;
}
.dash-nav .nav-links {
    display: flex;
    gap: 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
}
.dash-nav .nav-links a {
    color: inherit;
    text-decoration: none;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
}
.dash-nav .nav-links a.router-link-active {
    background: rgba(255, 255, 255, 0.1);
}
.dash-nav .user-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.dash-main {
    flex: 1;
    padding: 2rem 1.5rem;
}
.dash-footer {
    padding: 1rem 1.5rem;
    opacity: 0.6;
    text-align: center;
}
.view-stub {
    max-width: 60rem;
    margin: 0 auto;
}

/* ============================================================
   Phase 3c — Dashboard widgets (UPS + Monitoring)
   ============================================================ */

.dashboard-home {
    display: grid;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    grid-template-columns: 1fr;            /* mobile: 1 col */
}
@media (min-width: 900px) {
    .dashboard-home { grid-template-columns: 1fr 1fr; }
    .dashboard-home > .monitoring-widget { grid-column: 1 / -1; }
}

.widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
}

/* --- UpsWidget --- */

.ups-widget .ups-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.ups-widget .ups-summary small {
    display: block;
    color: var(--wa-color-neutral-on-quiet, #94a3b8);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.ups-widget .ups-summary .metric {
    font-size: 1.75rem;
    font-weight: 600;
}

.ups-widget .ups-chart {
    margin: 1rem 0;
    min-height: 250px;
    overflow: hidden;
}

.ups-widget .ups-last-update {
    text-align: center;
    color: var(--wa-color-neutral-on-quiet, #94a3b8);
    margin-top: 0.5rem;
}

/* --- MonitoringWidget --- */

.monitoring-widget .monitoring-loader {
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.monitoring-widget .monitoring-group {
    margin-bottom: 1.5rem;
}

.monitoring-widget .monitoring-group h6 {
    color: var(--wa-color-neutral-on-quiet, #94a3b8);
    font-size: 0.95rem;
    margin: 0 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.monitoring-widget .monitoring-row {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    grid-template-rows: auto auto;
    gap: 0.25rem 0.75rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--wa-color-neutral-border, rgba(148, 163, 184, 0.15));
    align-items: center;
}

.monitoring-widget .monitoring-row:last-child {
    border-bottom: none;
}

.monitoring-widget .monitor-type {
    grid-row: 1 / 3;
    font-size: 1.25rem;
}

.monitoring-widget .monitor-label {
    display: flex;
    flex-direction: column;
}

.monitoring-widget .monitor-label strong {
    font-weight: 500;
}

.monitoring-widget .monitor-label small {
    color: var(--wa-color-neutral-on-quiet, #94a3b8);
    font-size: 0.8rem;
}

.monitoring-widget .monitor-last-check {
    grid-column: 2 / 4;
    text-align: right;
    color: var(--wa-color-neutral-on-quiet, #94a3b8);
}

.monitoring-widget wa-progress-bar {
    grid-column: 1 / 4;
    margin-top: 0.25rem;
}

.monitoring-widget .monitoring-footer {
    margin-top: 1rem;
    text-align: right;
}

.monitoring-widget .monitoring-footer a {
    color: var(--wa-color-neutral-on-quiet, #94a3b8);
    text-decoration: underline;
}

/* ============================================================
   Phase 3a — SessionWidget / WeatherWidget / ServerWidget
   ============================================================ */

/* --- SessionWidget --- */

.session-widget .session-username {
    font-family: 'Yusei Magic', sans-serif;
    margin: 0 0 0.75rem 0;
}
.session-widget .session-meta {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.35rem 1rem;
    margin: 0;
}
.session-widget .session-meta dt { opacity: 0.7; font-size: 0.85rem; }
.session-widget .session-meta dd { margin: 0; }

/* --- WeatherWidget --- */

.weather-widget .weather-loading,
.weather-widget .weather-forecast {
    text-align: center;
    padding: 0.5rem;
}
.weather-widget .weather-forecast {
    display: flex;
    justify-content: space-around;
}
.weather-widget .weather-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}
.weather-widget .weather-day i { font-size: 2rem; }

/* --- ServerWidget --- */

.server-widget .jvm-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.server-widget .jvm-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}
.server-widget .server-info {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.35rem 1rem;
    margin: 0.75rem 0 0 0;
    padding-top: 0.75rem;
    border-top: 1px solid var(--wa-color-surface-border);
}
.server-widget .server-info dt { opacity: 0.7; font-size: 0.85rem; }
.server-widget .server-info dd { margin: 0; }
.server-widget .server-last-update {
    margin-top: 0.75rem;
    text-align: right;
    opacity: 0.6;
}

/* ---------------------------------------------------------------
   Phase 3b — FavorisView + UsagersView
   --------------------------------------------------------------- */

/* Shared view header */
.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.view-header h1 {
    margin: 0;
    font-size: 1.5rem;
}
.view-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Favoris */
.favoris-categories {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.favori-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--wa-color-neutral-200, #333);
}
.favori-row:last-child {
    border-bottom: none;
}
.favori-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}
.favori-icon-fallback {
    flex-shrink: 0;
    opacity: 0.5;
}
.favori-link {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.favori-actions {
    flex-shrink: 0;
    display: flex;
    gap: 0.25rem;
}

/* Usagers */
.usagers-table-wrapper {
    overflow-x: auto;
}
.usagers-table {
    width: 100%;
    border-collapse: collapse;
}
.usagers-table th,
.usagers-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--wa-color-neutral-200, #333);
}
.usagers-table th {
    font-weight: 600;
    opacity: 0.8;
}
.row-inactive {
    opacity: 0.5;
}

/* Form errors */
.field-error {
    color: var(--wa-color-danger-600, #dc3545);
    display: block;
    margin-top: 0.25rem;
}
.field-hint {
    color: var(--wa-color-neutral-500, #999);
    display: block;
    margin-top: 0.25rem;
    font-style: italic;
}
.input-error {
    --wa-input-border-color: var(--wa-color-danger-600, #dc3545);
}

/* Native select fallback (wa-select avait race condition WA 3.5.0) */
.native-select {
    background: var(--wa-color-surface-default, #1e293b);
    color: var(--wa-color-text-default, #e2e8f0);
    border: 1px solid var(--wa-color-neutral-200, #444);
    border-radius: 0.25rem;
    padding: 0.4rem 0.6rem;
    font-size: 1rem;
    font-family: inherit;
    min-width: 160px;
    cursor: pointer;
}
.native-select:focus {
    outline: 2px solid var(--wa-color-brand-500, #3b82f6);
    outline-offset: 1px;
}
.native-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.native-label {
    display: block;
    font-size: 0.9rem;
    color: var(--wa-color-text-default, #e2e8f0);
}
.native-label .native-select {
    display: block;
    margin-top: 0.25rem;
    width: 100%;
}
