/* Network Topology Styles */

#flatTopologyCanvasContainer {
    position: relative;
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    border: none;
    border-radius: 0;
    overflow: hidden;
    margin: 0;
    padding: 20px;
}

.loader-inline {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
}

.loader-inline .loader {
    color: #007bff;
    margin-bottom: 10px;
}

.loader-inline .loader-caption {
    color: #6c757d;
    font-weight: 500;
}

.nodata {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #6c757d;
    font-size: 16px;
    z-index: 5;
}

#topology_canvas {
    width: 100%;
    height: 100%;
    min-height: 600px;
    min-width: 800px;
    background: #ffffff;
    transform-origin: 0 0;
    transition: transform 0.1s ease-out;
    cursor: grab;
    user-select: none;
    display: block;
}

#topology_canvas:active {
    cursor: grabbing;
}

#topology_canvas.dragging {
    transition: none;
    cursor: grabbing !important;
}

/* 확대/축소 버튼 스타일 */
.topology-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.topology-control-btn {
    width: 40px;
    height: 40px;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: #495057;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.topology-control-btn:hover {
    background: #f0f0f0;
    border-color: #007bff;
    color: #007bff;
    transform: scale(1.05);
}

.topology-control-btn:active {
    transform: scale(0.95);
}

.topology-control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8f9fa;
    color: #6c757d;
    border-color: #dee2e6;
}

.topology-control-btn:disabled:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
    transform: none;
}

/* Network Styles */
.network {
    cursor: pointer;
}

.network_container_normal {
    fill: #8541B5;
}

.network_container_small {
    fill: #8541B5;
}

.network-name {
    font-family: 'Segoe UI', 'Malgun Gothic', '맑은 고딕', sans-serif;
    font-size: 14px;
    font-weight: 600;
    fill: #ffffff;
    text-anchor: middle;
    letter-spacing: 0.5px;
}

.network-cidr {
    font-family: 'Segoe UI', 'Malgun Gothic', '맑은 고딕', sans-serif;
    font-size: 12px;
    font-weight: 500;
    fill: #000000;
    text-anchor: middle;
    letter-spacing: 0.3px;
}

.network-type {
    font-family: 'Segoe UI', 'Malgun Gothic', '맑은 고딕', sans-serif;
    font-size: 10px;
    font-weight: 500;
    fill: #ffffff;
    text-anchor: middle;
    letter-spacing: 0.3px;
}

/* Device Styles */
.device {
    cursor: pointer;
}

.device_body {
    transition: all 0.2s ease;
}

.device:hover .frame {
    stroke: #007bff;
    stroke-width: 2;
    transform: scale(1.05);
    filter: brightness(1.1);
}

.device:hover .texts {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.device:hover {
    cursor: pointer;
}

.network:hover .network-rect {
    stroke: #007bff;
    stroke-width: 2;
}

/* Router Styles */
.router_normal {
    fill: #ffffff;
    stroke: #000000;
    stroke-width: 2;
}

.router_normal .frame {
    fill: #ffffff;
    stroke: #000000;
    stroke-width: 3;
}

.router_normal .texts text {
    font-family: 'Segoe UI', 'Malgun Gothic', '맑은 고딕', sans-serif;
    font-size: 11px;
    fill: #000000;
    stroke: none;
    text-anchor: middle;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.router_normal .texts_bg {
    fill: #000000;
    stroke: #000000;
    stroke-width: 1
}

/* Instance Styles */
.instance_normal {
    fill: #ffffff;
    stroke: none;
}

.instance_normal .frame {
    fill: #ffffff;
    stroke: #000000;
    stroke-width: 2;
}

.instance_normal .texts text {
    font-family: 'Segoe UI', 'Malgun Gothic', '맑은 고딕', sans-serif;
    font-size: 11px;
    fill: #000000;
    text-anchor: middle;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.instance_normal .texts_bg {
    fill: #f8f9fa;
    stroke: none;
}

/* Port Styles */
.port_text {
    font-family: 'Segoe UI', 'Malgun Gothic', '맑은 고딕', sans-serif;
    font-size: 10px;
    fill: #000000;
    font-weight: 300;
    letter-spacing: 0.3px;
    stroke: none;
}

.port_text.left {
    text-anchor: end;
}

/* Additional Router Styles */
.router_normal .frame {
    fill: #ffffff;
    stroke: #000000;
    stroke-width: 2;
}

.router_small .frame {
    fill: #ffffff;
    stroke: #1f77b4;
    stroke-width: 1;
}

.router_normal .texts .type {
    font-family: 'Segoe UI', 'Malgun Gothic', '맑은 고딕', sans-serif;
    font-size: 10px;
    font-weight: 500;
    fill: #ffffff;
    stroke: none;
    text-anchor: middle;
    letter-spacing: 0.3px;
}

.router_normal .name {
    font-family: 'Segoe UI', 'Malgun Gothic', '맑은 고딕', sans-serif;
    font-size: 12px;
    font-weight: 600;
    fill: #000000;
    stroke: none;
    text-anchor: middle;
    letter-spacing: 0.5px;
}

.router_small .type {
    font-family: Arial, sans-serif;
    font-size: 8px;
    fill: #1f77b4;
    text-anchor: middle;
}

/* Instance Styles */
.instance_normal .frame {
    fill: #ffffff;
    stroke: #000000;
    stroke-width: 2;
}

.instance_small .frame {
    fill: #ffffff;
    stroke: #ff7f0e;
    stroke-width: 1;
}

.instance_normal .texts_bg {
    fill: #000000;
}

.instance_normal .type {
    font-family: 'Segoe UI', 'Malgun Gothic', '맑은 고딕', sans-serif;
    font-size: 10px;
    font-weight: 500;
    fill: #ffffff;
    text-anchor: middle;
    letter-spacing: 0.3px;
}

.instance_normal .texts .type {
    font-family: 'Segoe UI', 'Malgun Gothic', '맑은 고딕', sans-serif;
    font-size: 10px;
    font-weight: 500;
    fill: #ffffff;
    stroke: none;
    text-anchor: middle;
    letter-spacing: 0.3px;
}

.instance_normal .name {
    font-family: 'Segoe UI', 'Malgun Gothic', '맑은 고딕', sans-serif;
    font-size: 12px;
    font-weight: 600;
    fill: #000000;
    text-anchor: middle;
    letter-spacing: 0.5px;
}

.instance_small .type {
    font-family: Arial, sans-serif;
    font-size: 8px;
    fill: #ff7f0e;
    text-anchor: middle;
}

/* Device Text Styles */
.device .name {
    font-size: 10px;
    font-weight: bold;
    fill: #333;
}

.device .type {
    font-size: 8px;
    fill: #666;
}

/* Icon Styles */
.icon_bg {
    fill: #ffffff;
    stroke: #000;
    stroke-width: 1;
}

.instance_bg {
    fill: #000000;
}

.active {
    fill: #28a745;
}

/* Port Styles */
.port_line {
    stroke-width: 3;
    stroke-linecap: round;
    opacity: 0.6;
}

.port_text {
    font-family: 'Segoe UI', 'Malgun Gothic', '맑은 고딕', sans-serif;
    font-size: 10px;
    fill: #333;
    text-anchor: middle;
    font-weight: bold;
    stroke: #ffffff;
    stroke-width: 0.5;
}

.port_text.left {
    text-anchor: end;
}

/* Connection Arrow Styles */
.connection_arrow {
    opacity: 0.9;
}

/* Network Connection Text */
.network_connection_text {
    font-family: 'Segoe UI', 'Malgun Gothic', '맑은 고딕', sans-serif;
    font-size: 9px;
    font-weight: bold;
    stroke: #ffffff;
    stroke-width: 0.5;
    opacity: 0.9;
}

/* Pattern Styles */
.base_bg_normal {
    fill: #f8f9fa;
}

.loading_bg_normal {
    fill: #e9ecef;
}

.base_bg_small {
    fill: #f8f9fa;
}

.loading_bg_small {
    fill: #e9ecef;
}

/* Topology Balloon Styles */
.topologyBalloon {
    position: absolute;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    width: 100%;
    max-width: 400px;
    display: none;
    pointer-events: auto;
}

.topologyBalloon .closeTopologyBalloon {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 18px;
    font-weight: bold;
    color: #6c757d;
    text-decoration: none;
    z-index: 1001;
}

.topologyBalloon .closeTopologyBalloon:hover {
    color: #000;
}

.topologyBalloon .contentBody {
    padding: 15px;
}

.topologyBalloon .detailInfoTable {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 15px;
}

.topologyBalloon .detailInfoTable caption {
    font-weight: bold;
    font-size: 16px;
    text-align: left;
    margin-bottom: 10px;
    color: #495057;
}

.topologyBalloon .detailInfoTable th {
    background: #f8f9fa;
    padding: 8px 12px;
    text-align: left;
    font-weight: bold;
    font-size: 12px;
    color: #495057;
    border: 1px solid #dee2e6;
    width: 30%;
}

.topologyBalloon .detailInfoTable td {
    padding: 8px 12px;
    font-size: 12px;
    color: #495057;
    border: 1px solid #dee2e6;
}

.topologyBalloon .portTableHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.topologyBalloon .portTableHeader .title {
    font-weight: bold;
    font-size: 14px;
    color: #495057;
}

.topologyBalloon .footer {
    border-top: 1px solid #dee2e6;
    padding: 10px 15px;
    background: #f8f9fa;
}

.topologyBalloon .footerInner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topologyBalloon .footer .link a {
    color: #007bff;
    text-decoration: none;
    font-size: 12px;
}

.topologyBalloon .footer .link a:hover {
    text-decoration: underline;
}

.topologyBalloon .active {
    color: #28a745;
    font-weight: bold;
}

.topologyBalloon .btn {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 3px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.topologyBalloon .btn-default {
    color: #495057;
    background-color: #ffffff;
    border-color: #ced4da;
}

.topologyBalloon .btn-danger {
    color: #ffffff;
    background-color: #dc3545;
    border-color: #dc3545;
}

.topologyBalloon .btn-xs {
    padding: 2px 6px;
    font-size: 10px;
}

.topologyBalloon .fa {
    margin-right: 4px;
}

/* 라우터 화살표 스타일 */
.router-arrow-1,
.router-arrow-2,
.router-arrow-3,
.router-arrow-4 {
    fill: #000000;
    stroke: none;
}

/* 상태 표시 스타일 */
.active {
    color: #28a745;
    font-weight: bold;
}

.paused {
    color: #ffc107;
    font-weight: bold;
}

.inactive {
    color: #dc3545;
    font-weight: bold;
}
