/* 全体的なスタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

:root {
    --primary-color: #3498db;
    --primary-dark: #2980b9;
    --accent-color: #27ae60;
    --accent-dark: #219955;
    --bg-light: #f5f7fa;
    --text-main: #333;
    --text-light: #7f8c8d;
    --border-color: #ddd;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ヘッダー */
header {
    background: linear-gradient(135deg, #2c3e50 0%, #1a5276 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-bottom: 3px solid var(--accent-color);
}

header h1 {
    font-weight: 600;
    margin-bottom: 5px;
}

/* メインコンテンツ */
main {
    padding: 30px 0;
    min-height: calc(100vh - 160px);
}

/* データリスト画面 */
.search-box {
    margin-bottom: 20px;
}

.search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.filter-tag {
    background-color: #ecf0f1;
    color: #7f8c8d;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-tag:hover {
    background-color: #e0e6e8;
}

.filter-tag.active {
    background-color: var(--primary-color);
    color: white;
}

#search-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

#search-input:focus {
    border-color: #3498db;
    outline: none;
}

.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.data-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border-top: 3px solid var(--primary-color);
}

.data-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.data-card h3 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 18px;
}

.data-card p {
    color: #7f8c8d;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.4;
}

.data-card .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.data-card .tag {
    background-color: #ecf0f1;
    color: #7f8c8d;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 4px;
}

.data-card .update-date {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 12px;
    color: #95a5a6;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

/* データ詳細画面 */
.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    position: relative;
}

.header-buttons {
    display: flex;
    gap: 15px;
}

.data-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
    font-size: 0.9rem;
    color: var(--text-light);
    align-items: center;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.detail-tag {
    background-color: #ecf0f1;
    color: #7f8c8d;
    font-size: 0.8rem;
    padding: 3px 10px;
    border-radius: 20px;
}

.sample-caption {
    font-size: 0.85rem;
    color: var(--text-light);
    font-style: italic;
    margin: 5px 0 15px;
}

.detail-header h2 {
    flex-grow: 1;
}

#back-button {
    padding: 8px 15px;
    background-color: #ecf0f1;
    border: none;
    border-radius: 4px;
    color: #2c3e50;
    cursor: pointer;
    font-size: 14px;
    margin-right: 15px;
    transition: background-color 0.3s;
}

#back-button:hover {
    background-color: #dde4e6;
}

.apply-button {
    padding: 10px 20px;
    background-color: #27ae60;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.apply-button:hover {
    background-color: #219955;
}

.detail-content {
    display: flex;
    gap: 30px;
    height: auto;
    min-height: 700px;
}

.left-panel {
    flex: 1;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-top: 3px solid var(--primary-color);
    display: flex;
    flex-direction: column;
}

.right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ユースケースセクション */
.use-cases {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-top: 3px solid var(--primary-color);
    display: flex;
    flex-direction: column;
    overflow: auto;
    min-height: 200px;
}

/* データグラフセクション */
.data-graph {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-top: 3px solid var(--primary-color);
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.sample-data {
    margin-top: 15px;
    overflow-x: auto;
}

.sample-data table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.sample-data th, .sample-data td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sample-data th {
    background-color: #f2f2f2;
    font-weight: 600;
}

.sample-data tr:nth-child(even) {
    background-color: #f9f9f9;
}

#use-cases-list {
    margin-top: 15px;
    padding-left: 20px;
    list-style-type: none;
    overflow-y: auto;
    flex-grow: 1;
}

#use-cases-list li {
    margin-bottom: 15px;
    position: relative;
    padding-left: 15px;
    line-height: 1.5;
}

#use-cases-list li:before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-size: 1.2rem;
}

#use-cases-list li .use-case-title {
    font-weight: 600;
    color: var(--text-main);
    display: block;
    margin-bottom: 4px;
}

#use-cases-list li .use-case-desc {
    color: var(--text-light);
    font-size: 0.9rem;
}

#graph-container, .usecase-graph-container {
    height: 350px;
    margin-top: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 可視化タブ関連のスタイル */
.visualization-tabs {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
}

.tab-controls {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid #ddd;
    margin-bottom: 15px;
}

.tab-button {
    padding: 8px 15px;
    background-color: #f5f7fa;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 5px 5px 0 0;
    margin-right: 5px;
    cursor: pointer;
    font-size: 14px;
    color: #7f8c8d;
    transition: all 0.3s;
}

.tab-button:hover {
    background-color: #ecf0f1;
}

.tab-button.active {
    background-color: white;
    color: #2c3e50;
    border-bottom: 1px solid white;
    margin-bottom: -1px;
    font-weight: 600;
}

.tab-content {
    background-color: white;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    width: 100%;
}

#usecase-tabs {
    display: flex;
    flex-wrap: wrap;
}

.usecase-caption {
    margin-bottom: 10px;
    color: #7f8c8d;
    font-style: italic;
    font-size: 14px;
}

/* ユーティリティクラス */
.hidden {
    display: none;
}

.active {
    display: block;
}

/* フッター */
footer {
    background-color: #2c3e50;
    color: white;
    padding: 15px 0;
    text-align: center;
    font-size: 14px;
}

/* レスポンシブデザイン */
@media (max-width: 900px) {
    .detail-content {
        flex-direction: column;
    }
    
    .left-panel, .right-panel {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .data-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .detail-header h2 {
        margin-bottom: 15px;
    }
    
    .detail-header button {
        margin-bottom: 10px;
    }
    
    #apply-button {
        margin-left: 0;
    }
}
