/* AI Daily News - Modern Dark Theme */

/* ===== カスタムプロパティ ===== */
:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --bg-card-hover: #263548;
    --bg-input: #0f172a;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #38bdf8;
    --accent-hover: #7dd3fc;
    --accent-gradient: linear-gradient(135deg, #38bdf8, #818cf8);
    --accent-gradient-hover: linear-gradient(135deg, #7dd3fc, #a5b4fc);
    --border: #334155;
    --border-light: #475569;
    --success: #34d399;
    --success-bg: rgba(52, 211, 153, 0.1);
    --error: #f87171;
    --error-bg: rgba(248, 113, 113, 0.1);
    --warning: #fbbf24;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --transition: 0.2s ease;
}

/* ===== リセット＆ベース ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.85em;
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent);
    padding: 0.15em 0.5em;
    border-radius: 4px;
}

/* ===== ナビゲーション ===== */
.site-nav {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--text-primary);
}

.nav-brand .brand-icon {
    font-size: 1.4rem;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    list-style: none;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
    background: rgba(56, 189, 248, 0.1);
}

.nav-links a.active {
    color: var(--accent);
}

/* ===== ヒーローヘッダー ===== */
.hero {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 3rem 2rem 2.5rem;
    text-align: center;
}

.hero-inner {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.hero .subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.hero .badge {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.3rem 0.9rem;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 50px;
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 600;
}

/* ===== メインコンテンツ ===== */
.container {
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 3rem;
    flex: 1;
}

/* ===== カードコンポーネント ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.card-header .count {
    font-size: 0.75rem;
    background: var(--accent-gradient);
    color: #0f172a;
    padding: 0.15rem 0.6rem;
    border-radius: 50px;
    font-weight: 700;
}

/* ===== テーブル ===== */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

thead th {
    text-align: left;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid var(--border);
}

tbody tr {
    transition: background var(--transition);
}

tbody tr:hover {
    background: rgba(56, 189, 248, 0.04);
}

tbody td {
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.5);
    vertical-align: middle;
}

tbody td:first-child {
    font-weight: 500;
    color: var(--text-primary);
}

/* パーサーバッジ */
.parser-badge {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-weight: 600;
}

.parser-badge.rss {
    background: rgba(251, 191, 36, 0.12);
    color: var(--warning);
    border: 1px solid rgba(251, 191, 36, 0.25);
}

.parser-badge.html_list {
    background: rgba(129, 140, 248, 0.12);
    color: #a5b4fc;
    border: 1px solid rgba(129, 140, 248, 0.25);
}

/* URL列 */
.url-cell a {
    color: var(--text-secondary);
    font-size: 0.82rem;
    word-break: break-all;
}

.url-cell a:hover {
    color: var(--accent);
}

/* ===== ボタン ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.8rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #0f172a;
    box-shadow: 0 2px 12px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
    background: var(--accent-gradient-hover);
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ===== 進捗表示 ===== */
.progress-box {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
    background: var(--bg-card);
}

.progress-box .stage-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.progress-box .detail {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.progress-bar-track {
    width: 100%;
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 3px;
    animation: progress-indeterminate 1.5s ease-in-out infinite;
}

@keyframes progress-indeterminate {
    0% { width: 0%; margin-left: 0; }
    50% { width: 60%; margin-left: 20%; }
    100% { width: 0%; margin-left: 100%; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

.progress-box.completed {
    border-color: var(--success);
    background: var(--success-bg);
}

.progress-box.completed .stage-label {
    color: var(--success);
}

.progress-box.error {
    border-color: var(--error);
    background: var(--error-bg);
}

.progress-box.error .stage-label {
    color: var(--error);
}

/* ===== 戦略立案セクション ===== */
.generate-section {
    text-align: center;
    padding: 2rem;
}

.generate-section p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 1.5rem;
    font-size: 0.95rem;
}

/* ===== 提案書表示 ===== */
.proposal-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.meta-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

.meta-item .meta-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.meta-item .meta-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.proposal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem;
    width: 100%;
    line-height: 1.9;
}

.proposal-content h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--accent);
}

.proposal-content h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}

.proposal-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1.8rem;
    margin-bottom: 0.6rem;
}

.proposal-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 1.2rem;
}

.proposal-content p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.proposal-content ul, .proposal-content ol {
    margin: 0.8rem 0 1rem 1.5rem;
    color: var(--text-secondary);
}

.proposal-content li {
    margin-bottom: 0.4rem;
}

.proposal-content strong {
    color: var(--text-primary);
}

.proposal-content table {
    margin: 1rem 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.proposal-content table th {
    background: rgba(56, 189, 248, 0.08);
}

/* ===== 削除ボタン ===== */
.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.9rem;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--error);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    margin-left: 0.5rem;
}

.btn-danger:hover {
    background: rgba(248, 113, 113, 0.2);
    border-color: var(--error);
}

/* ===== 履歴テーブル ===== */
.history-table td:last-child a {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.9rem;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    transition: all var(--transition);
}

.history-table td:last-child a:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: var(--accent);
}

/* ===== フッター ===== */
.site-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

/* ===== エラー表示 ===== */
.notice {
    background: var(--error-bg);
    border: 1px solid var(--error);
    border-radius: var(--radius-sm);
    padding: 1rem 1.5rem;
    color: var(--error);
    font-weight: 500;
}

/* ===== ダッシュボード ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow);
}

.stat-icon {
    font-size: 2rem;
    line-height: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.shortcut-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.shortcut-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    text-align: center;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}

.shortcut-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.shortcut-icon {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
}

.shortcut-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.shortcut-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ===== レスポンシブ ===== */
@media (max-width: 768px) {
    .nav-inner {
        padding: 0 1rem;
        flex-direction: column;
        height: auto;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero {
        padding: 2rem 1rem 1.5rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .container {
        padding: 1rem;
    }

    .card {
        padding: 1rem;
    }

    .proposal-content {
        padding: 1.5rem;
    }

    .proposal-meta {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .shortcut-grid {
        grid-template-columns: 1fr;
    }

    table {
        font-size: 0.82rem;
    }

    .url-cell {
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}
