/*
 * This file is part of a proprietary application owned by The Sysval project.
 *
 * Copyright (c) Sysval <contact@sysval.fr>
 *
 * This is confidential and proprietary software. All rights reserved.
 * Unauthorized copying, modification or distribution is strictly prohibited.
 */

/* ==========================================================================
   Modale des messages applicatifs (bienvenue, releases, annonces)
   ========================================================================== */

.app-msg-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.3s;
}

.app-msg-modal {
    background: var(--bg-card, #fff);
    color: var(--text-color, #1a1a2e);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: app-msg-slide-up 0.3s ease-out;
}

@keyframes app-msg-slide-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Header --- */

.app-msg-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.app-msg-title {
    flex: 1;
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.app-msg-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted, #888);
    line-height: 1;
    padding: 0;
}

.app-msg-close:hover {
    color: var(--text-color, #1a1a2e);
}

/* --- Badges de type --- */

.app-msg-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-msg-badge-info {
    background: #e3f2fd;
    color: #1565c0;
}

.app-msg-badge-release {
    background: #e8f5e9;
    color: #2e7d32;
}

.app-msg-badge-notice {
    background: #fff3e0;
    color: #e65100;
}

/* --- Body (contenu Markdown rendu) --- */

.app-msg-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    line-height: 1.6;
}

.app-msg-body h2 {
    font-size: 1.1rem;
    margin: 1.2rem 0 0.5rem;
    color: var(--text-color, #1a1a2e);
}

.app-msg-body h2:first-child {
    margin-top: 0;
}

.app-msg-body ul {
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

.app-msg-body li {
    margin-bottom: 0.3rem;
}

.app-msg-body p {
    margin: 0.5rem 0;
}

.app-msg-body code {
    background: var(--bg-muted, #f5f5f5);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
}

/* --- Footer (navigation + bouton OK) --- */

.app-msg-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color, #e0e0e0);
    gap: 1rem;
}

.app-msg-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.app-msg-counter {
    font-size: 0.85rem;
    color: var(--text-muted, #888);
    min-width: 3rem;
    text-align: center;
}

/* --- Responsive --- */

@media (width <= 600px) {
    .app-msg-modal {
        width: 95%;
        max-height: 90vh;
        border-radius: 8px;
    }

    .app-msg-footer {
        flex-direction: column;
    }
}

/* --- Dark mode — palette anthracite neutre --- */

html.dark {
    --bg-card: #1e1e22;
    --bg-muted: #2a2a30;
    --text-color: #e6e6ea;
    --text-muted: #9090a0;
    --border-color: #34343c;
}

html.dark .app-msg-overlay { background: rgba(0, 0, 0, 0.7); }

html.dark .app-msg-badge-info {
    background: rgba(21, 101, 192, 0.18);
    color: #6fb3ee;
}

html.dark .app-msg-badge-release {
    background: rgba(46, 125, 50, 0.18);
    color: #5dd286;
}

html.dark .app-msg-badge-notice {
    background: rgba(176, 94, 0, 0.18);
    color: #e9a961;
}
