/* Denial Network Visualization - Frontend Styles */

.denial-network-container {
    max-width: 100%;
    margin: 2rem auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.dnv-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.dnv-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dnv-filter-btn {
    background: #ffffff;
    border: 2px solid #9B7EBF;
    color: #9B7EBF;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
    text-transform: lowercase;
}

.dnv-filter-btn:hover {
    background: #F4F0F8;
}

.dnv-filter-btn.active {
    background: #9B7EBF;
    color: #ffffff;
}

.dnv-search input {
    padding: 0.5rem 1rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    min-width: 250px;
}

.dnv-search input:focus {
    outline: none;
    border-color: #9B7EBF;
}

.dnv-legend {
    background: #ffffff;
    border: 1px solid #ddd;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.dnv-legend h3 {
    margin: 0 0 0.75rem 0;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #333;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.legend-color {
    width: 24px;
    height: 24px;
    border: 2px solid #666;
    display: inline-block;
}

.legend-color.accommodation {
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
}

.legend-color.systemic {
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}

.legend-color.personal {
    border-radius: 4px;
}

.legend-arrow {
    width: 30px;
    height: 2px;
    position: relative;
    display: inline-block;
}

.legend-arrow.denies {
    background: #E74C3C;
}

.legend-arrow.enables {
    background: #9B7EBF;
}

.legend-arrow::after {
    content: '';
    position: absolute;
    right: 0;
    top: -3px;
    width: 0;
    height: 0;
    border-left: 8px solid;
    border-left-color: inherit;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
}

#denial-network {
    position: relative;
    width: 100%;
}

/* Modal Styles */
.dnv-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.dnv-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.dnv-modal-content {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 8px;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.dnv-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    font-weight: 300;
    color: #666;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.dnv-modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

#dnv-modal-body {
    margin-right: 2rem;
}

#dnv-modal-body h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.75rem;
    color: #333;
    line-height: 1.3;
}

#dnv-modal-body .node-type {
    display: inline-block;
    background: #9B7EBF;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

#dnv-modal-body .node-type.accommodation {
    background: #FF9999;
}

#dnv-modal-body .node-type.systemic {
    background: #9B7EBF;
}

#dnv-modal-body .node-type.personal {
    background: #C4A5D4;
}

#dnv-modal-body h3 {
    margin: 1.5rem 0 0.75rem 0;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
}

#dnv-modal-body .narrative,
#dnv-modal-body .description,
#dnv-modal-body .node-content {
    margin: 1rem 0;
    line-height: 1.7;
    color: #333;
    font-size: 0.95rem;
}

#dnv-modal-body .node-content p {
    margin-bottom: 1rem;
}

#dnv-modal-body .node-content h1,
#dnv-modal-body .node-content h2,
#dnv-modal-body .node-content h3,
#dnv-modal-body .node-content h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #333;
}

#dnv-modal-body .node-content ul,
#dnv-modal-body .node-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

#dnv-modal-body .node-content blockquote {
    border-left: 4px solid #9B7EBF;
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #666;
}

#dnv-modal-body .node-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 1rem 0;
}

#dnv-modal-body .connection-list {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
}

#dnv-modal-body .connection-item {
    display: flex;
    align-items: flex-start;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: #f8f8f8;
    border-left: 4px solid #9B7EBF;
    border-radius: 4px;
    transition: all 0.2s ease;
}

#dnv-modal-body .connection-item[data-node-id] {
    cursor: pointer;
}

#dnv-modal-body .connection-item[data-node-id]:hover {
    background: #f0f0f0;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#dnv-modal-body .connection-item.denies {
    border-left-color: #E74C3C;
}

#dnv-modal-body .connection-item.enables {
    border-left-color: #9B7EBF;
}

#dnv-modal-body .connection-label {
    font-weight: 600;
    color: #333;
    flex: 1;
}

#dnv-modal-body .intensity-badge {
    background: #333;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

#dnv-modal-body .empty-state {
    color: #999;
    font-style: italic;
    padding: 1rem;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dnv-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .dnv-buttons {
        flex-direction: column;
    }
    
    .dnv-filter-btn {
        width: 100%;
        text-align: center;
    }
    
    .dnv-search input {
        width: 100%;
        min-width: 0;
    }
    
    .dnv-modal-content {
        max-width: 95%;
        max-height: 90vh;
        padding: 1.5rem;
    }
    
    #dnv-modal-body {
        margin-right: 0;
    }
    
    #denial-network {
        height: 500px !important;
    }
}

/* Loading State */
.dnv-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    font-size: 1.1rem;
    color: #666;
}

.dnv-loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Intensity visualization in edges */
.cy-edge-intensity-1 { opacity: 0.3; }
.cy-edge-intensity-2 { opacity: 0.5; }
.cy-edge-intensity-3 { opacity: 0.7; }
.cy-edge-intensity-4 { opacity: 0.85; }
.cy-edge-intensity-5 { opacity: 1.0; }
