body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.header h1 {
    color: #333;
    margin: 0;
    font-size: 24px;
    transition: color 0.3s ease;
}

.stats-container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.stats {
    background: white;
    padding: 10px 15px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    min-width: 80px;
}

.stat-value {
    font-size: 20px;
    font-weight: bold;
    color: #2196F3;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 12px;
    color: #666;
    transition: color 0.3s ease;
}

.main-container {
    display: flex;
    gap: 15px;
    height: calc(100vh - 120px);
    min-height: 500px;
    position: relative;
}

.graph-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* flexアイテムのはみ出しを防ぐ */
}

#cy {
    width: 100%;
    flex: 1;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.controls {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.control-button {
    background: #2196F3;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.3s ease;
}

.control-button:hover {
    background: #1976D2;
}

.info-panel {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 320px;
    max-width: 100vw;
    max-height: 100%;
    overflow-y: auto;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-sizing: border-box;
}

.info-panel.hidden {
    width: 0;
    padding: 0;
    overflow: hidden;
    min-width: 0;
}

.info-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.location-item {
    background: #f8f9fa;
    padding: 8px 12px;
    margin: 5px 0;
    border-radius: 4px;
    border-left: 4px solid #2196F3;
    transition: background-color 0.3s ease;
}

.location-file {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    color: #666;
    transition: color 0.3s ease;
}

.location-link {
    color: #2196F3;
    text-decoration: none;
    font-weight: bold;
}

.location-link:hover {
    text-decoration: underline;
}

.edge-info {
    background: #e3f2fd;
    padding: 8px 12px;
    margin: 5px 0;
    border-radius: 4px;
    border-left: 4px solid #1976D2;
    transition: background-color 0.3s ease;
}

.generated-time {
    text-align: center;
    color: #999;
    font-size: 11px;
    margin-top: 10px;
    transition: color 0.3s ease;
}

/* レスポンシブデザイン */
@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
        height: auto;
        min-height: 400px;
    }

    .info-panel {
        width: 100% !important;
        max-height: 300px;
        order: 2;
    }

    .info-panel.hidden {
        height: 0;
        padding: 0;
        min-height: 0;
    }

    .graph-container {
        order: 1;
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        text-align: center;
    }

    .stats-container {
        justify-content: center;
    }

    .controls {
        justify-content: center;
    }

    .control-button {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #121212;
        color: #e0e0e0;
    }

    .header h1 {
        color: #ffffff;
    }

    .stats {
        background: #1e1e1e;
        box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    }

    .stat-label {
        color: #b0b0b0;
    }

    #cy {
        background-color: #1e1e1e;
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }

    .control-button {
        background: #2196F3;
    }

    .control-button:hover {
        background: #1976D2;
    }

    .info-panel {
        background: #1e1e1e;
        box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    }

    .info-title {
        color: #ffffff;
    }

    .location-item {
        background: #2a2a2a;
    }

    .location-file {
        color: #b0b0b0;
    }

    .edge-info {
        background: #1a2d3a;
    }

    .generated-time {
        color: #888;
    }
}
