/* ATC Survey Report - Custom Styles */

/* CSS Variables for ATC Brand Colors */
:root {
    --primary-purple: #7B5BA4;
    --primary-purple-light: #9B7BC4;
    --primary-purple-dark: #5B4B84;
    --accent-yellow: #FFE500;
    --accent-yellow-light: #FFF066;
    --text-dark: #1F2937;
    --text-muted: #6B7280;
    --bg-light: #F9FAFB;
    --bg-white: #FFFFFF;
    --border-light: #E5E7EB;
    --success-green: #10B981;
    --warning-orange: #F59E0B;
    --danger-red: #EF4444;
}

/* Base Styles */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, var(--bg-white) 0%, var(--bg-light) 100%);
    border-bottom: 1px solid var(--border-light);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.header-logo {
    max-height: 50px;
    width: auto;
}

.nav-link {
    position: relative;
    color: var(--text-dark);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background-color: rgba(123, 91, 164, 0.1);
    color: var(--primary-purple);
}

.nav-link.active {
    background-color: var(--primary-purple);
    color: white;
}

/* KPI Cards */
.kpi-card {
    background: var(--bg-white);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-purple), var(--accent-yellow));
}

.kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(123, 91, 164, 0.15);
}

.kpi-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-purple);
    line-height: 1.2;
}

.kpi-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.kpi-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-purple-light), var(--primary-purple));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

/* Filter Panel */
.filter-panel {
    background: var(--bg-white);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-light);
}

.filter-group {
    margin-bottom: 1rem;
}

.filter-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-light);
    border-radius: 9999px;
    background: var(--bg-white);
    color: var(--text-dark);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0.25rem;
}

.filter-btn:hover {
    border-color: var(--primary-purple);
    color: var(--primary-purple);
}

.filter-btn.active {
    background: var(--primary-purple);
    border-color: var(--primary-purple);
    color: white;
}

.filter-reset {
    background: transparent;
    border: 2px dashed var(--border-light);
    color: var(--text-muted);
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-reset:hover {
    border-color: var(--danger-red);
    color: var(--danger-red);
}

/* Chart Cards */
.chart-card {
    background: var(--bg-white);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-light);
}

.chart-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-light);
}

.chart-container {
    position: relative;
    width: 100%;
    min-height: 300px;
}

/* Story Page Styles */
.story-chapter {
    background: var(--bg-white);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-light);
    position: relative;
}

.story-chapter::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary-purple), var(--accent-yellow));
    border-radius: 4px 0 0 4px;
}

.chapter-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--primary-purple);
    color: white;
    font-weight: 700;
    border-radius: 50%;
    margin-right: 1rem;
}

.chapter-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.quote-box {
    background: linear-gradient(135deg, rgba(123, 91, 164, 0.05), rgba(255, 229, 0, 0.05));
    border-left: 4px solid var(--primary-purple);
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    border-radius: 0 0.5rem 0.5rem 0;
    font-style: italic;
}

.quote-source {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-style: normal;
    margin-top: 0.5rem;
}

.insight-box {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    margin: 1rem 0;
}

.insight-title {
    font-weight: 600;
    color: var(--success-green);
    margin-bottom: 0.5rem;
}

.warning-box {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    margin: 1rem 0;
}

.warning-title {
    font-weight: 600;
    color: var(--warning-orange);
    margin-bottom: 0.5rem;
}

/* Stat Highlight */
.stat-highlight {
    display: inline-flex;
    align-items: baseline;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, var(--primary-purple-light), var(--primary-purple));
    color: white;
    border-radius: 0.5rem;
    font-weight: 700;
    margin: 0 0.25rem;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.data-table th {
    background: var(--primary-purple);
    color: white;
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
}

.data-table th:first-child {
    border-radius: 0.5rem 0 0 0;
}

.data-table th:last-child {
    border-radius: 0 0.5rem 0 0;
}

.data-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
}

.data-table tr:hover td {
    background-color: rgba(123, 91, 164, 0.05);
}

/* Funnel Chart */
.funnel-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.funnel-step {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    color: white;
    font-weight: 500;
    transition: transform 0.2s ease;
}

.funnel-step:hover {
    transform: scale(1.02);
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    .no-print {
        display: none !important;
    }

    .kpi-card,
    .chart-card,
    .story-chapter {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }

    .header {
        position: static;
        box-shadow: none;
    }

    @page {
        margin: 1.5cm;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.5s ease-out forwards;
}

.animate-delay-1 {
    animation-delay: 0.1s;
}

.animate-delay-2 {
    animation-delay: 0.2s;
}

.animate-delay-3 {
    animation-delay: 0.3s;
}

.animate-delay-4 {
    animation-delay: 0.4s;
}

/* Progress Bar in TOC */
.progress-indicator {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-purple), var(--accent-yellow));
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Button Styles */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-purple-dark));
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(123, 91, 164, 0.4);
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--primary-purple);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    border: 2px solid var(--primary-purple);
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: var(--primary-purple);
    color: white;
}

/* Footer */
.footer {
    background: var(--text-dark);
    color: white;
    padding: 2rem 0;
}

.footer a {
    color: var(--accent-yellow);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .kpi-value {
        font-size: 2rem;
    }

    .chart-container {
        min-height: 250px;
    }

    .story-chapter {
        padding: 1.5rem;
    }
}

/* Sticky Filter Indicator */
.sticky-filter-indicator {
    position: fixed;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-purple-dark));
    color: white;
    border-radius: 16px;
    padding: 16px;
    min-width: 140px;
    max-width: 180px;
    box-shadow: 0 8px 32px rgba(123, 91, 164, 0.4);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sticky-filter-indicator.visible {
    opacity: 1;
    visibility: visible;
}

.sticky-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.sticky-reset-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background 0.2s ease;
}

.sticky-reset-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

.sticky-filter-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.sticky-filter-tag {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
}

.sticky-filter-empty {
    font-size: 0.75rem;
    opacity: 0.7;
}

.sticky-filter-count {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* Hide on mobile */
@media (max-width: 1024px) {
    .sticky-filter-indicator {
        display: none !important;
    }
}