/* CSS Reset & Basics */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #1e1e1e;
    color: #e0e0e0;
    height: 100vh;
    display: flex;
    overflow: hidden;
}

h1 {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 0.2rem;
}

p {
    font-size: 0.85rem;
    color: #888;
}

/* Layout */
.sidebar {
    width: 30%;
    min-width: 300px;
    background-color: #252526;
    border-right: 1px solid #333;
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 20px;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.main-content {
    flex-grow: 1;
    position: relative;
    background-color: #1e1e1e;
    /* Dot grid pattern for graph background */
    background-image: radial-gradient(#333 1px, transparent 1px);
    background-size: 20px 20px;
}

#cy {
    width: 100%;
    height: 100%;
    display: block;
}

/* Controls */
.control-group {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 8px;
}

label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #bbb;
}

textarea {
    flex-grow: 1;
    background-color: #1e1e1e;
    border: 1px solid #3e3e42;
    color: #d4d4d4;
    padding: 10px;
    font-family: 'Roboto Mono', monospace;
    font-size: 13px;
    border-radius: 4px;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
}

textarea:focus {
    border-color: #007fd4;
}

.drop-zone {
    border: 2px dashed #444;
    border-radius: 6px;
    padding: 20px;
    text-align: center;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: #007fd4;
    background-color: rgba(0, 127, 212, 0.1);
    color: #ccc;
}

.drop-zone .icon {
    font-size: 24px;
}

/* Buttons */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    padding: 12px;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 0.9rem;
}

.btn-primary {
    background-color: #007fd4;
    color: white;
}

.btn-primary:hover {
    background-color: #0060a0;
}

.btn-secondary {
    background-color: #3e3e42;
    color: white;
}

.btn-secondary:hover {
    background-color: #4e4e52;
}

/* Feedback */
.error-msg {
    color: #f48771;
    font-size: 0.85rem;
    font-weight: bold;
    padding: 5px 0;
    display: block;
}

/* Legend */
.legend {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background-color: rgba(37, 37, 38, 0.9);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #333;
    pointer-events: none;
    /* Let clicks pass through if needed, though usually we want interactions */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    min-width: 150px;
}

.legend h4 {
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #fff;
    border-bottom: 1px solid #444;
    padding-bottom: 5px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: #ccc;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.dot.allow {
    background-color: #4CAF50;
}

/* Vert */
.dot.deny {
    background-color: #F44336;
    border: 1px dashed white;
}

/* Rouge */
.dot.principal {
    background-color: #2196F3;
}

/* Bleu */
.dot.resource {
    background-color: #FF9800;
}

/* Orange */

.legend-controls {
    margin-top: 10px;
    color: #666;
    font-size: 0.75rem;
    border-top: 1px solid #333;
    padding-top: 5px;
}

/* Security Badge */
.security-badge {
    background: rgba(76, 175, 80, 0.1);
    color: #4CAF50;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-top: 10px;
    display: inline-block;
    border: 1px solid rgba(76, 175, 80, 0.3);
    font-weight: 500;
}

/* Footer */
.footer {
    margin-top: auto;
    padding-top: 20px;
    text-align: center;
    border-top: 1px solid #333;
}

.footer a {
    color: #666;
    text-decoration: none;
    font-size: 0.75rem;
    transition: color 0.2s;
    font-family: 'Roboto Mono', monospace;
}

.footer a:hover {
    color: #007fd4;
}