:root {
    --bg-color: #0d1117;
    --card-bg: rgba(22, 27, 34, 0.75);
    --border-color: rgba(255, 255, 255, 0.1);
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --accent-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Bandeau Supérieur Commun */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 2rem;
    background: rgba(13, 17, 23, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 1.5rem;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}

.brand-version {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Menu de Navigation Principal (Navbar) */
.app-nav {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 0.5rem;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 0.95rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.nav-link:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
    color: var(--primary-color);
    background: rgba(59, 130, 246, 0.12);
    font-weight: 600;
}

.nav-link.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.arrow {
    font-size: 0.75rem;
}

.dropdown-menu {
    position: absolute;
    top: 130%;
    left: 0;
    background: #161b22;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    min-width: 220px;
    display: none;
    flex-direction: column;
    overflow: visible !important;
    z-index: 101;
}

.dropdown-menu.show {
    display: flex;
}

.dropdown-submenu {
    position: relative;
    width: 100%;
}

.dropdown-item {
    background: none;
    border: none;
    color: var(--text-main);
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.9rem;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.dropdown-submenu-title {
    user-select: none;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.sub-arrow {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: auto;
}

.dropdown-sub-menu {
    position: absolute;
    top: 0;
    left: 100%;
    margin-left: 4px;
    background: #161b22;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    min-width: 220px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 105;
}

.dropdown-submenu:hover > .dropdown-sub-menu,
.dropdown-sub-menu.show {
    display: flex !important;
}

.target-domain-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 9999px;
    font-size: 0.85rem;
    font-family: var(--font-mono);
    color: var(--accent-color);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.8; }
}

/* Modale du Rapport d'Évolution */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-overlay.show {
    display: flex;
}

.modal-card {
    background: #161b22;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90%;
    max-width: 850px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-num {
    font-size: 1.75rem;
    font-weight: 700;
}

.stat-num.highlight {
    color: var(--primary-color);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.evolution-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.evolution-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
}

.evolution-item.ajouté {
    border-left-color: var(--accent-color);
}

.evolution-item.modifié {
    border-left-color: var(--warning-color);
}

.badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge.ajouté {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-color);
}

.badge.modifié {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning-color);
}

.entity-type {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 0.8rem;
}

.entity-name {
    font-weight: 600;
}

.details {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-left: auto;
}

.empty-diff {
    text-align: center;
    padding: 2rem;
    color: var(--accent-color);
    font-weight: 500;
}

/* Notification Toast */
.app-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: #161b22;
    border: 1px solid var(--border-color);
    padding: 0.85rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    font-size: 0.9rem;
    display: none;
    z-index: 2000;
}

.app-notification.show {
    display: block;
}

.app-notification.error {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

/* Main Container */
.main-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    width: 100%;
    flex: 1;
}

.app-footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
}
