/**
 * 管理画面 CSS
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f5f7fa;
    color: #333;
}

.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ヘッダー */
.admin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.admin-header h1 {
    font-size: 24px;
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-name {
    font-size: 14px;
    opacity: 0.9;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 8px 16px;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 統計カード */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: #667eea;
}

.stat-like .stat-value {
    color: #4caf50;
}

.stat-dislike .stat-value {
    color: #f44336;
}

.stat-unanswered .stat-value {
    color: #ff9800;
}

/* タブ */
.tab-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 24px;
    background: white;
    color: #666;
    text-decoration: none;
    border-radius: 8px 8px 0 0;
    font-weight: 500;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: #f0f0f0;
}

.tab-btn.active {
    background: white;
    color: #667eea;
    border-bottom: 3px solid #667eea;
}

/* コンテンツコンテナ */
.content-container {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.content-header h2 {
    font-size: 20px;
    color: #333;
}

/* フィルターフォーム */
.filter-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.date-input,
.feedback-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.feedback-select {
    cursor: pointer;
    background-color: white;
}

.btn-filter,
.btn-reset {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-filter {
    background: #667eea;
    color: white;
}

.btn-filter:hover {
    background: #5568d3;
}

.btn-reset {
    background: #f0f0f0;
    color: #666;
}

.btn-reset:hover {
    background: #e0e0e0;
}

/* テーブル */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table thead {
    background: #f8f9fa;
}

.data-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #dee2e6;
}

.data-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

.data-table tbody tr:hover {
    background: #f8f9fa;
}

.timestamp {
    white-space: nowrap;
    color: #666;
    font-size: 13px;
}

.message-cell {
    max-width: 400px;
}

.message-content {
    line-height: 1.6;
    color: #333;
}

.session-id {
    font-family: monospace;
    font-size: 12px;
    color: #999;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

/* 案内メッセージ */
.info-message {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    margin: 20px 0;
}

.info-message p {
    margin: 10px 0;
    font-size: 16px;
    color: #495057;
}

.info-message p:first-child {
    font-size: 18px;
    font-weight: 500;
    color: #212529;
}

/* フィードバックバッジ */
.feedback-type {
    text-align: center;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.badge-like {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-dislike {
    background: #ffebee;
    color: #c62828;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .admin-container {
        padding: 10px;
    }

    .admin-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .filter-form {
        width: 100%;
        flex-direction: column;
    }

    .date-input,
    .feedback-select,
    .btn-filter,
    .btn-reset {
        width: 100%;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 8px;
    }
}

/* ダッシュボード */
.dashboard-container {
    padding: 20px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.chart-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.chart-card h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.chart-card canvas {
    max-height: 300px;
}

/* 低評価リスト */
.dislike-list {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dislike-list h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #c62828;
    font-weight: 600;
}

.dislike-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.dislike-item {
    padding: 15px;
    background: #fff5f5;
    border-left: 4px solid #c62828;
    border-radius: 4px;
}

.dislike-time {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}

.dislike-q,
.dislike-a {
    margin: 5px 0;
    font-size: 14px;
    line-height: 1.6;
}

.dislike-q strong,
.dislike-a strong {
    color: #666;
}

/* ダッシュボードのレスポンシブ */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* レポート */
.report-container {
    padding: 20px;
}

.report-container h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
    color: #333;
}

.report-description {
    margin: 0 0 30px 0;
    color: #666;
    font-size: 14px;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.report-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.report-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.report-icon {
    font-size: 40px;
    margin-bottom: 15px;
}

.report-card h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
}

.report-card p {
    margin: 0 0 15px 0;
    color: #666;
    font-size: 14px;
}

.report-details {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.report-details li {
    padding: 5px 0;
    color: #888;
    font-size: 13px;
}

.report-details li:before {
    content: "✓ ";
    color: #667eea;
    font-weight: bold;
    margin-right: 5px;
}

.report-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.date-range {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.date-range label {
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

.date-range input[type="date"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.date-range span {
    color: #999;
}

.btn-download {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-download:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

/* クイックエクスポート */
.quick-export {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.quick-export h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
}

.quick-export p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 14px;
}

.quick-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.btn-quick {
    display: block;
    padding: 12px 20px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    text-align: center;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-quick:hover {
    background: #667eea;
    border-color: #667eea;
    color: white;
    transform: translateY(-1px);
}

/* 使い方ガイド */
.report-guide {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.report-guide h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #333;
}

.guide-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.guide-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
}

.guide-item strong {
    display: block;
    margin-bottom: 8px;
    color: #667eea;
    font-size: 14px;
}

.guide-item p {
    margin: 0;
    color: #666;
    font-size: 13px;
    line-height: 1.6;
}

/* レポートのレスポンシブ */
@media (max-width: 1024px) {
    .report-grid {
        grid-template-columns: 1fr;
    }

    .guide-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .quick-buttons {
        grid-template-columns: 1fr;
    }

    .date-range {
        flex-direction: column;
        align-items: flex-start;
    }

    .date-range input[type="date"] {
        width: 100%;
    }
}

/* 検索機能 */
.search-container {
    padding: 20px;
}

.search-container h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
    color: #333;
}

.search-description {
    margin: 0 0 30px 0;
    color: #666;
    font-size: 14px;
}

/* 検索フォーム */
.search-form {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.search-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-search {
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.btn-search:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.search-options {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.search-options label {
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

.search-options span {
    color: #999;
}

.btn-reset-search {
    padding: 8px 16px;
    background: #f0f0f0;
    color: #666;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-reset-search:hover {
    background: #e0e0e0;
}

/* 検索通知 */
.search-notice {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.search-notice p {
    font-size: 16px;
    margin: 10px 0;
}

.search-hint {
    font-size: 14px;
    color: #aaa;
}

/* 検索結果 */
.search-results {
    margin-top: 30px;
}

.search-summary {
    background: #e8f4f8;
    padding: 15px 20px;
    border-radius: 6px;
    border-left: 4px solid #667eea;
    margin-bottom: 30px;
    font-size: 15px;
    color: #333;
}

.search-summary strong {
    color: #667eea;
}

.search-period {
    color: #666;
    font-size: 14px;
    margin-left: 10px;
}

.result-section {
    margin-bottom: 40px;
}

.result-section h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

/* ハイライト表示 */
.search-highlight mark {
    background-color: #fff59d;
    color: #000;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* 検索結果のレスポンシブ */
@media (max-width: 768px) {
    .search-input-group {
        flex-direction: column;
    }

    .btn-search {
        width: 100%;
    }

    .search-options {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-options .date-input,
    .btn-reset-search {
        width: 100%;
    }
}

/* 検索フィルター */
.search-filters {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-right: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 設定画面 */
.settings-container {
    padding: 20px;
}

.settings-container h2 {
    margin: 0 0 30px 0;
    font-size: 24px;
    color: #333;
}

.settings-section {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.settings-section h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

.settings-description {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

/* ベクトルステータスカード */
.embedding-status-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.status-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.status-icon {
    font-size: 28px;
}

.status-text {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.status-details {
    margin-bottom: 20px;
}

.status-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.status-row:last-child {
    border-bottom: none;
}

.status-label {
    color: #666;
    font-size: 14px;
}

.status-value {
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

.status-actions {
    display: flex;
    gap: 15px;
}

.btn-generate {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-generate:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.btn-generate:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-delete-embeddings {
    background: #f0f0f0;
    color: #c62828;
    border: 1px solid #e0e0e0;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-delete-embeddings:hover {
    background: #ffebee;
    border-color: #c62828;
}

/* 進捗表示 */
.progress-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 100%;
    animation: progress-indeterminate 1.5s ease-in-out infinite;
}

@keyframes progress-indeterminate {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.progress-text {
    font-size: 14px;
    color: #666;
    text-align: center;
}

/* 設定情報 */
.settings-info {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.settings-info h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #667eea;
}

.settings-info ul {
    margin: 0;
    padding-left: 20px;
}

.settings-info li {
    margin: 8px 0;
    color: #555;
    font-size: 14px;
    line-height: 1.6;
}

/* 設定値リスト */
.config-list {
    background: white;
    padding: 20px;
    border-radius: 8px;
}

.config-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.config-item:last-child {
    border-bottom: none;
}

.config-label {
    color: #666;
    font-size: 14px;
}

.config-value {
    color: #333;
    font-size: 14px;
    font-weight: 500;
    font-family: monospace;
}

.config-value.status-on {
    color: #2e7d32;
    background-color: #e8f5e9;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: inherit;
}

.config-value.status-off {
    color: #757575;
    background-color: #f5f5f5;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: inherit;
}

/* CSV出力ボタン */
.btn-export-csv {
    display: inline-block;
    padding: 8px 16px;
    background: #4caf50;
    color: white;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s;
}

.btn-export-csv:hover {
    background: #43a047;
}

/* 設定画面のレスポンシブ */
@media (max-width: 768px) {
    .status-actions {
        flex-direction: column;
    }

    .btn-generate,
    .btn-delete-embeddings {
        width: 100%;
    }

    .config-item {
        flex-direction: column;
        gap: 5px;
    }

    .config-label {
        font-weight: 500;
    }
}
