/* ===========================================
   Sentinelle IA - Dashboard, Security Levels,
   Agents, Flow, Compliance
   =========================================== */

/* Hero Stats */
.hero-stats {
    display: flex;
    gap: 2rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.hero-stat {
    text-align: center;
    padding: 1rem 1.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    min-width: 120px;
}

.hero-stat-number {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--apex-accent);
    line-height: 1.2;
}

.hero-stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Guard Gate / SIAP Section */
.guard-gate-section {
    padding: var(--section-padding);
    background: var(--apex-darker);
}

.guard-gate-card {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem;
    background: var(--glass-bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    text-align: center;
}

.guard-gate-card h3 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.siap-subtitle {
    color: var(--apex-accent) !important;
    font-weight: 600 !important;
    font-size: 1rem !important;
    margin-bottom: 1.5rem !important;
}

.guard-gate-card p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.siap-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
    text-align: left;
}

.siap-detail {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.siap-detail-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--apex-accent);
    margin-bottom: 0.35rem;
}

.siap-detail-value {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ============================
   13 Agents - 3 Defensive Lines
   ============================ */
.agents-section {
    padding: var(--section-padding);
}

.defense-line {
    margin-bottom: 3rem;
}

.defense-line:last-child {
    margin-bottom: 0;
}

.defense-line-header {
    padding: 1.5rem 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    border-left: 4px solid;
}

.defense-line-header.line-1 {
    border-left-color: var(--sentinelle-peace);
    background: rgba(34, 197, 94, 0.05);
}

.defense-line-header.line-2 {
    border-left-color: var(--sentinelle-alert);
    background: rgba(245, 158, 11, 0.05);
}

.defense-line-header.line-3 {
    border-left-color: var(--sentinelle-war);
    background: rgba(239, 68, 68, 0.05);
}

.defense-line-header.line-ext {
    border-left-color: var(--apex-accent);
    background: rgba(34, 211, 238, 0.05);
}

.defense-line-number {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.25rem;
}

.line-1 .defense-line-number { color: var(--sentinelle-peace); }
.line-2 .defense-line-number { color: var(--sentinelle-alert); }
.line-3 .defense-line-number { color: var(--sentinelle-war); }
.line-ext .defense-line-number { color: var(--apex-accent); }

.defense-line-header h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
}

.defense-line-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

.agents-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    max-width: var(--container-max);
    margin: 0 auto;
}

.agents-grid.agents-grid-7 {
    grid-template-columns: repeat(4, 1fr);
}

.agent-card {
    padding: 1.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    position: relative;
}

.agent-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
    background: var(--glass-bg-hover);
}

.agent-port {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    font-family: monospace;
    color: var(--apex-accent);
    background: rgba(34, 211, 238, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.75rem;
}

.agent-card h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.agent-tech {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--sentinelle-peace);
    vertical-align: middle;
}

.agent-card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0;
}

/* Security Levels */
.security-levels-section {
    padding: var(--section-padding);
    background: var(--apex-darker);
}

.security-levels {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    max-width: var(--container-max);
    margin: 0 auto;
}

.security-level {
    padding: 2rem 1.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.security-level::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.security-level.level-peace::before {
    background: var(--sentinelle-peace);
}

.security-level.level-alert::before {
    background: var(--sentinelle-alert);
}

.security-level.level-war::before {
    background: var(--sentinelle-war);
}

.security-level .level-badge {
    display: inline-block;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.level-peace .level-badge { color: var(--sentinelle-peace); }
.level-alert .level-badge { color: var(--sentinelle-alert); }
.level-war .level-badge { color: var(--sentinelle-war); }

.security-level .level-name {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

.level-peace .level-name { color: var(--sentinelle-peace); }
.level-alert .level-name { color: var(--sentinelle-alert); }
.level-war .level-name { color: var(--sentinelle-war); }

.security-level .level-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.level-rate {
    font-size: 0.8rem;
    font-weight: 700;
    font-family: monospace;
    color: var(--text-muted);
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-subtle);
}

/* Modes Bar */
.modes-bar {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    margin-top: 2rem;
    padding: 1.25rem 2rem;
    background: var(--glass-bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.mode-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.mode-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.mode-peace .mode-dot { background: var(--sentinelle-peace); }
.mode-alert .mode-dot { background: var(--sentinelle-alert); }
.mode-war .mode-dot { background: var(--sentinelle-war); }

/* Simulator Dashboard */
.simulator-section {
    padding: var(--section-padding);
}

.simulator-dashboard {
    max-width: 900px;
    margin: 0 auto;
    padding: 2.5rem;
    background: rgba(10, 10, 15, 0.8);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.dashboard-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--sentinelle-peace);
    transition: background 0.5s ease;
}

.status-indicator.alert { background: var(--sentinelle-alert); }
.status-indicator.war { background: var(--sentinelle-war); }

.status-text {
    font-weight: 700;
    font-size: 1.1rem;
    transition: color 0.5s ease;
}

.status-text.peace { color: var(--sentinelle-peace); }
.status-text.alert { color: var(--sentinelle-alert); }
.status-text.war { color: var(--sentinelle-war); }

.btn-simulate {
    padding: 0.75rem 1.5rem;
    background: rgba(239, 68, 68, 0.15);
    color: var(--sentinelle-war);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: inherit;
}

.btn-simulate:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: var(--sentinelle-war);
}

.btn-simulate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dashboard-line-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--border-subtle);
}

/* Module bars */
.dashboard-modules {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.4rem;
}

.module-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.4rem 0;
    transition: opacity 0.5s ease;
}

.module-bar.dimmed {
    opacity: 0.25;
}

.module-bar.critical {
    opacity: 1;
}

.module-bar-label {
    width: 180px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.module-bar-track {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.module-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease, background-color 0.5s ease;
    width: 60%;
}

.module-bar-fill.line1 { background: var(--sentinelle-peace); }
.module-bar-fill.line2 { background: var(--sentinelle-alert); }
.module-bar-fill.line3 { background: var(--sentinelle-war); }

/* Veto flash overlay */
.veto-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(239, 68, 68, 0.15);
    border-radius: var(--radius-xl);
    z-index: 10;
    align-items: center;
    justify-content: center;
}

.veto-overlay.active {
    display: flex;
    animation: vetoFlash 0.5s ease;
}

.veto-text {
    font-size: 3rem;
    font-weight: 800;
    color: var(--sentinelle-war);
    letter-spacing: 8px;
    text-transform: uppercase;
}

@keyframes vetoFlash {
    0% { opacity: 0; }
    30% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0.8; }
}

/* ============================
   Prompt Processing Flow
   ============================ */
.flow-section {
    padding: var(--section-padding);
    background: var(--apex-darker);
}

/* ============================
   Prompt Flow Pipeline
   ============================ */
.prompt-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    max-width: 560px;
    margin: 0 auto;
    position: relative;
    padding: 1rem 0;
}

/* Vertical timeline glow */
.prompt-flow::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(99,102,241,0.15) 3%,
        rgba(34,211,238,0.2) 12%,
        rgba(34,197,94,0.25) 30%,
        rgba(239,68,68,0.25) 48%,
        rgba(167,139,250,0.35) 55%,
        rgba(245,158,11,0.25) 70%,
        rgba(34,197,94,0.2) 85%,
        rgba(99,102,241,0.15) 97%,
        transparent
    );
    pointer-events: none;
}

/* Section badges (Aller / Retour) */
.pf-badge {
    position: relative;
    z-index: 1;
    display: inline-block;
    padding: 0.3rem 1.2rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-radius: 20px;
    margin: 0.5rem 0;
}

.pf-badge-aller {
    color: var(--apex-accent);
    background: rgba(34,211,238,0.06);
    border: 1px solid rgba(34,211,238,0.2);
}

.pf-badge-retour {
    color: var(--sentinelle-alert);
    background: rgba(245,158,11,0.06);
    border: 1px solid rgba(245,158,11,0.2);
    margin-top: 0.75rem;
}

/* Pipe connectors */
.pf-pipe {
    width: 2px;
    height: 14px;
    background: rgba(255,255,255,0.06);
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.pf-pipe::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid rgba(255,255,255,0.12);
}

/* Nodes (pills) */
.pf-node {
    padding: 0.5rem 1.8rem;
    border-radius: 22px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    position: relative;
    z-index: 1;
    line-height: 1.3;
}

.pf-node small {
    display: block;
    font-size: 0.72rem;
    font-weight: 400;
    opacity: 0.55;
    margin-top: 0.15rem;
}

.pf-user {
    background: rgba(99,102,241,0.12);
    border: 1px solid rgba(99,102,241,0.3);
    color: #a5b4fc;
}

.pf-ext {
    background: rgba(34,211,238,0.07);
    border: 1px solid rgba(34,211,238,0.25);
    color: #22d3ee;
}

.pf-llm {
    background: rgba(167,139,250,0.12);
    border: 1.5px solid rgba(167,139,250,0.45);
    color: #a78bfa;
    font-size: 1.15rem;
    font-weight: 800;
    padding: 0.65rem 3rem;
    letter-spacing: 2px;
    box-shadow: 0 0 24px rgba(167,139,250,0.12), 0 0 60px rgba(167,139,250,0.05);
    margin: 0.25rem 0;
}

/* Groups (Ligne boxes) */
.pf-group {
    width: 100%;
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-md);
    position: relative;
    z-index: 1;
}

.pf-group-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    text-align: center;
}

.pf-l1 {
    background: rgba(34,197,94,0.03);
    border: 1px solid rgba(34,197,94,0.18);
}
.pf-l1 .pf-group-label { color: var(--sentinelle-peace); }

.pf-l2 {
    background: rgba(245,158,11,0.03);
    border: 1px solid rgba(245,158,11,0.18);
}
.pf-l2 .pf-group-label { color: var(--sentinelle-alert); }

.pf-l3 {
    background: rgba(239,68,68,0.03);
    border: 1px solid rgba(239,68,68,0.18);
}
.pf-l3 .pf-group-label { color: var(--sentinelle-war); }

/* Agent pills inside groups */
.pf-agents {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: center;
}

.pf-agents span {
    padding: 0.25rem 0.7rem;
    border-radius: 14px;
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
}

.pf-l1 .pf-agents span {
    background: rgba(34,197,94,0.07);
    border: 1px solid rgba(34,197,94,0.15);
    color: #86efac;
}

.pf-l2 .pf-agents span {
    background: rgba(245,158,11,0.07);
    border: 1px solid rgba(245,158,11,0.15);
    color: #fcd34d;
}

.pf-l3 .pf-agents span {
    background: rgba(239,68,68,0.07);
    border: 1px solid rgba(239,68,68,0.15);
    color: #fca5a5;
}

.pf-agents em {
    font-style: normal;
    font-size: 0.65rem;
    opacity: 0.45;
    font-family: monospace;
}

/* ============================
   Dashboard CISO Gallery
   ============================ */
.dashboard-gallery {
    margin-top: 3rem;
    padding: 2.5rem;
    background: rgba(10, 10, 15, 0.6);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
}

.dashboard-gallery-header {
    text-align: center;
    margin-bottom: 2rem;
}

.dashboard-gallery-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--apex-accent);
}

.dashboard-gallery-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 600px;
    margin: 0 auto;
}

.dashboard-gallery-main {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 1rem;
    background: #080810;
}

.dashboard-gallery-main img {
    display: block;
    width: 100%;
    height: auto;
    transition: opacity 0.3s ease;
}

.dashboard-gallery-thumbs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.6rem;
}

.gallery-thumb {
    background: rgba(255, 255, 255, 0.02);
    border: 2px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-sm);
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    transition: all var(--transition-base);
    display: flex;
    flex-direction: column;
    font-family: inherit;
}

.gallery-thumb:hover {
    border-color: rgba(34, 211, 238, 0.3);
    background: rgba(255, 255, 255, 0.04);
}

.gallery-thumb.active {
    border-color: var(--apex-accent);
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.15);
}

.gallery-thumb img {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0.6;
    transition: opacity var(--transition-base);
}

.gallery-thumb:hover img,
.gallery-thumb.active img {
    opacity: 1;
}

.gallery-thumb span {
    display: block;
    padding: 0.35rem 0.25rem;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    text-align: center;
}

.gallery-thumb.active span {
    color: var(--apex-accent);
}

/* ============================
   Compliance Section
   ============================ */
.compliance-section {
    padding: var(--section-padding);
}

.compliance-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    max-width: var(--container-max);
    margin: 0 auto;
}

.compliance-card {
    padding: 2rem;
    background: var(--glass-bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.compliance-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.compliance-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--apex-accent);
}

.compliance-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.compliance-owasp {
    margin-top: 2rem;
    padding: 2rem;
    background: var(--glass-bg);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
}

.compliance-owasp h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--sentinelle-alert);
}

.compliance-owasp p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.7;
}

/* ============================
   Responsive
   ============================ */
@media (max-width: 1024px) {
    .agents-grid,
    .agents-grid.agents-grid-7 {
        grid-template-columns: repeat(2, 1fr);
    }

    .security-levels {
        grid-template-columns: repeat(3, 1fr);
    }

    .compliance-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .security-levels {
        grid-template-columns: repeat(2, 1fr);
    }

    .agents-grid,
    .agents-grid.agents-grid-7 {
        grid-template-columns: 1fr;
    }

    .compliance-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .module-bar-label {
        width: 130px;
        font-size: 0.78rem;
    }

    .simulator-dashboard {
        padding: 1.5rem;
    }

    .guard-gate-card {
        padding: 2rem;
    }

    .siap-details {
        grid-template-columns: 1fr;
    }

    .hero-stats {
        gap: 1rem;
    }

    .hero-stat {
        min-width: 100px;
        padding: 0.75rem 1rem;
    }

    .hero-stat-number {
        font-size: 1.3rem;
    }

    .modes-bar {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
    }

    .dashboard-gallery {
        padding: 1.5rem;
    }

    .dashboard-gallery-thumbs {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.4rem;
    }

    .gallery-thumb span {
        font-size: 0.6rem;
        padding: 0.25rem 0.15rem;
    }

    .prompt-flow {
        max-width: 100%;
        padding: 0.5rem 0;
    }

    .pf-node {
        font-size: 0.82rem;
        padding: 0.45rem 1.2rem;
    }

    .pf-llm {
        font-size: 1rem;
        padding: 0.5rem 2rem;
    }

    .pf-agents span {
        font-size: 0.72rem;
        padding: 0.2rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .security-levels {
        grid-template-columns: 1fr;
    }

    .module-bar-label {
        width: 100px;
    }

    .hero-stats {
        flex-direction: column;
        align-items: center;
    }

    .hero-stat {
        width: 100%;
        max-width: 200px;
    }

    .dashboard-gallery-thumbs {
        grid-template-columns: repeat(3, 1fr);
    }

    .dashboard-gallery-header h3 {
        font-size: 1.15rem;
    }
}
