/* ============================================
   VARIABLES CSS
============================================ */
:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-accent: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
    --accent-blue: #60a5fa;
    --accent-indigo: #818cf8;
    --accent-teal: #2dd4bf;
    --accent-purple: #a78bfa;
    --accent-pink: #f472b6;
}

/* ============================================
   RESET & BASE
============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================
   CONTAINER
============================================ */
.network-container {
    padding: 2rem;
    max-width: 2400px;
    margin: 0 auto;
}

/* ============================================
   HEADER
============================================ */
.network-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 3rem 2rem;
    background: var(--bg-secondary);
    border-radius: 20px;
    border: 2px solid var(--border);
    position: relative;
}

.network-header h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.network-header p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.back-btn {
    display: inline-block;
    padding: 1rem 2rem;
    background: rgba(96, 165, 250, 0.1);
    color: var(--accent-blue);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    border: 2px solid var(--accent-blue);
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: var(--accent-blue);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(96, 165, 250, 0.3);
}

/* ============================================
   NETWORK WRAPPER & DIAGRAM
============================================ */
.network-wrapper {
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 3rem;
    border: 2px solid var(--border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    margin-bottom: 2rem;
}

.network-diagram {
    width: 100%;
    height: auto;
    display: block;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.5) 0%, rgba(30, 41, 59, 0.5) 100%);
    border-radius: 12px;
}

/* ============================================
   NETWORK NODES - STYLES DE BASE
============================================ */
.network-node {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.network-node:hover rect {
    stroke-width: 4;
    filter: brightness(1.2);
}

.network-node:hover text {
    fill: var(--accent-blue);
}

.network-node:active {
    transform: scale(0.98);
}

/* Router Nodes */
.router-node:hover rect {
    fill: #334155;
    stroke: var(--accent-blue);
}

/* Proxmox Nodes */
.proxmox-node:hover rect {
    fill: #334155;
    stroke: var(--accent-indigo);
}

/* VM Nodes */
.vm-node:hover rect {
    fill: #334155;
    stroke: var(--accent-indigo);
}

/* Docker Host */
.docker-host-node:hover rect {
    fill: #334155;
    stroke: var(--accent-teal);
}

/* Container Nodes */
.container-node:hover rect {
    fill: #334155;
    stroke: var(--accent-teal);
}

/* ============================================
   STATS BOX
============================================ */
.stats-box {
    opacity: 1;
}

/* ============================================
   LÉGENDE
============================================ */
.legend {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 2px solid var(--border);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.legend-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.legend-item span {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ============================================
   MODAL
============================================ */
.node-modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { 
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to { 
        opacity: 1;
        backdrop-filter: blur(10px);
    }
}

.node-modal-content {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    margin: 3% auto;
    padding: 0;
    border: 2px solid rgba(96, 165, 250, 0.3);
    border-radius: 24px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.7);
    position: relative;
    animation: slideDown 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-100px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Close Button */
.node-modal-close {
    position: absolute;
    right: 2rem;
    top: 2rem;
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    z-index: 10;
    background: rgba(0, 0, 0, 0.3);
}

.node-modal-close:hover {
    color: var(--accent-blue);
    background: rgba(96, 165, 250, 0.2);
    transform: rotate(90deg) scale(1.1);
}

/* Modal Header */
.node-modal-header {
    background: rgba(30, 41, 59, 0.8);
    padding: 3rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    border-bottom: 2px solid rgba(96, 165, 250, 0.2);
    position: relative;
}

.node-modal-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    flex-shrink: 0;
    box-shadow: 0 10px 30px rgba(96, 165, 250, 0.4);
}

.node-modal-header-text {
    flex: 1;
}

.node-modal-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.node-modal-subtitle {
    font-size: 1.1rem;
    color: var(--accent-blue);
    font-weight: 600;
    margin: 0;
}

/* Modal Body */
.node-modal-body {
    padding: 3rem;
}

.node-modal-description {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border-left: 4px solid var(--accent-blue);
}

/* Modal Specs */
.node-modal-specs {
    background: rgba(15, 23, 42, 0.5);
    border-radius: 16px;
    padding: 2rem;
    border: 2px solid rgba(96, 165, 250, 0.2);
}

.node-modal-specs h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.node-modal-specs h3::before {
    content: '⚙️';
    font-size: 1.8rem;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(96, 165, 250, 0.1);
    transition: all 0.3s ease;
}

.spec-item:hover {
    background: rgba(96, 165, 250, 0.05);
    padding-left: 1rem;
    padding-right: 1rem;
    margin: 0 -1rem;
    border-radius: 8px;
}

.spec-item:last-child {
    border-bottom: none;
}

.spec-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.05rem;
}

.spec-label::before {
    content: '▸ ';
    color: var(--accent-blue);
    font-weight: bold;
}

.spec-value {
    color: var(--accent-teal);
    text-align: right;
    font-weight: 500;
    font-size: 1.05rem;
}

/* ============================================
   SCROLLBAR PERSONNALISÉE
============================================ */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-blue);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-indigo);
}

/* ============================================
   RESPONSIVE DESIGN
============================================ */
@media (max-width: 1400px) {
    .network-diagram {
        max-width: 100%;
    }
}

@media (max-width: 1024px) {
    .network-wrapper {
        padding: 2rem;
    }
    
    .network-header h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .network-container {
        padding: 1rem;
    }

    .network-header {
        padding: 2rem 1rem;
    }

    .network-header h1 {
        font-size: 2rem;
    }

    .network-header p {
        font-size: 1rem;
    }

    .network-wrapper {
        padding: 1rem;
    }

    .node-modal-content {
        width: 95%;
        margin: 5% auto;
    }

    .node-modal-header {
        flex-direction: column;
        text-align: center;
        padding: 2rem;
    }

    .node-modal-icon {
        width: 80px;
        height: 80px;
        font-size: 2.5rem;
    }

    .node-modal-title {
        font-size: 1.8rem;
    }

    .node-modal-body {
        padding: 2rem;
    }

    .legend {
        gap: 1.5rem;
    }

    .spec-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .spec-value {
        text-align: left;
    }
}

@media (max-width: 480px) {
    .network-header h1 {
        font-size: 1.5rem;
    }

    .back-btn {
        padding: 0.8rem 1.5rem;
        font-size: 0.9rem;
    }

    .node-modal-title {
        font-size: 1.5rem;
    }

    .node-modal-description {
        font-size: 1rem;
    }
}