/* GAINA Automation RPA シミュレーションサイト - カスタムスタイル */

/* フォント設定 */
* {
    font-family: 'Noto Sans JP', sans-serif;
}

/* アニメーション */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

.count-up {
    animation: countUp 0.8s ease-out;
}

@keyframes countUp {
    from { 
        transform: scale(1.2); 
        opacity: 0.8; 
    }
    to { 
        transform: scale(1); 
        opacity: 1; 
    }
}

/* サービスカード選択状態 */
.service-card.selected {
    border-color: #3b82f6 !important;
    background-color: #eff6ff !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.service-card:hover {
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

/* 基本契約保険会社の選択状態 */
.basic-company-option.selected-basic {
    border-color: #3b82f6 !important;
    background-color: #eff6ff !important;
    color: #1e40af !important;
    font-weight: 600;
}

.basic-company-option {
    transition: all 0.2s ease;
    cursor: pointer;
}

.basic-company-option:hover {
    border-color: #93c5fd;
    background-color: #f8fafc;
}

/* カスタムチェックボックス */
input[type="checkbox"]:checked + span {
    color: #1f2937;
    font-weight: 500;
}

/* レスポンシブ調整 */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .grid.md\\:grid-cols-3 {
        grid-template-columns: 1fr;
    }
    
    .grid.md\\:grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .lg\\:col-span-2 {
        grid-column: span 1;
    }
    
    .lg\\:col-span-1 {
        grid-column: span 1;
    }
}

/* スクロールバーカスタマイズ */
.overflow-y-auto::-webkit-scrollbar {
    width: 6px;
}

.overflow-y-auto::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.overflow-y-auto::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.overflow-y-auto::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* フォーカス状態 */
input:focus,
select:focus {
    outline: none;
    ring: 2px;
    ring-color: #3b82f6;
    border-color: #3b82f6;
}

/* ボタンホバー効果 */
button:hover {
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

button:active {
    transform: translateY(0);
}

/* グラデーション背景 */
.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 結果表示エリアのアニメーション */
#resultsDisplay .count-up {
    display: inline-block;
}

/* チャートコンテナ */
#chartContainer {
    position: relative;
    height: 300px;
}

#effectChartContainer {
    position: relative;
    height: 400px;
}

/* エラー状態 */
.error {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
}

.error-message {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* 成功状態 */
.success {
    border-color: #10b981 !important;
    background-color: #f0fdf4 !important;
}

/* ローディング状態 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    border: 2px solid #f3f4f6;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 0.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 効果シミュレーション結果表示 */
.effect-result-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.effect-breakdown-table {
    background-color: #f8fafc;
}

.effect-breakdown-table th {
    background-color: #e2e8f0;
    font-weight: 600;
}

.effect-breakdown-table td {
    border-bottom: 1px solid #e2e8f0;
}

/* 提案書スタイル（ダウンロード用） */
.proposal-document {
    font-family: 'Noto Sans JP', sans-serif;
    max-width: 210mm;
    max-height: 280mm;
    margin: 0 auto;
    padding: 10mm;
    background: white;
    color: #333;
    line-height: 1.4;
    overflow: hidden;
}

.proposal-document h1 {
    font-size: 16pt;
    font-weight: bold;
    text-align: center;
    margin-bottom: 8px;
    color: #1f2937;
}

.proposal-document h2 {
    font-size: 14pt;
    font-weight: bold;
    margin: 12px 0 6px 0;
    color: #374151;
    border-bottom: 2px solid #3b82f6;
    padding-bottom: 2px;
}

.proposal-document h3 {
    font-size: 11pt;
    font-weight: bold;
    margin: 8px 0 4px 0;
    color: #4b5563;
}

.proposal-document .main-effect {
    font-size: 20pt;
    font-weight: bold;
    text-align: center;
    color: #059669;
    margin: 6px 0;
}

.proposal-document .sub-effect {
    font-size: 14pt;
    font-weight: bold;
    color: #0d9488;
    margin: 4px 0;
}

.proposal-document table {
    width: 100%;
    border-collapse: collapse;
    margin: 6px 0;
    font-size: 9pt;
}

.proposal-document th, .proposal-document td {
    border: 1px solid #d1d5db;
    padding: 4px;
    text-align: left;
}

.proposal-document th {
    background-color: #f3f4f6;
    font-weight: bold;
}

.proposal-document .two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 6px 0;
}

.proposal-document .highlight-box {
    background-color: #f0f9ff;
    border: 1px solid #0ea5e9;
    padding: 6px;
    border-radius: 4px;
    margin: 4px 0;
}

/* 印刷用スタイル */
@media print {
    header,
    footer,
    button,
    .hidden,
    nav,
    .no-print {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .bg-white {
        background: white !important;
    }
    
    .shadow-lg {
        box-shadow: none !important;
        border: 1px solid #e5e7eb;
    }
    
    .proposal-document {
        max-height: 280mm !important;
        overflow: hidden !important;
        margin: 0;
        padding: 12mm 10mm;
        page-break-inside: avoid;
    }
    
    @page {
        size: A4;
        margin: 0;
    }
}

/* ダークモード対応（将来の拡張用） */
@media (prefers-color-scheme: dark) {
    /* 必要に応じてダークモード対応を追加 */
}

/* アクセシビリティ改善 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* モバイル向け調整 */
@media (max-width: 640px) {
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .text-2xl {
        font-size: 1.25rem;
    }
    
    .text-xl {
        font-size: 1.125rem;
    }
    
    .p-6 {
        padding: 1rem;
    }
    
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    .space-x-4 > * + * {
        margin-left: 0;
        margin-top: 0.5rem;
    }
}

/* テーブルレスポンシブ */
@media (max-width: 768px) {
    .overflow-x-auto {
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
}

/* フォームバリデーション視覚効果 */
.form-field.invalid {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.form-field.valid {
    border-color: #10b981;
    background-color: #f0fdf4;
}

/* カード選択エフェクト */
.selection-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.selection-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.selection-card.selected {
    transform: translateY(-2px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* ツールチップ */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2937;
    color: white;
    padding: 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1000;
}

.tooltip:hover::before {
    content: '';
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1f2937;
    z-index: 1000;
}

/* 顧客クラスタリング用スタイル */
.customer-clustering-table {
    font-size: 12px;
}

.customer-clustering-table th {
    background-color: #f3f4f6;
    font-weight: 600;
    border: 1px solid #d1d5db;
}

.customer-clustering-table td {
    border: 1px solid #d1d5db;
}

.customer-status-hot {
    background-color: #dcfdf7;
    color: #065f46;
}

.customer-status-active {
    background-color: #fef3c7;
    color: #92400e;
}

.customer-status-new {
    background-color: #dbeafe;
    color: #1e40af;
}

.customer-status-dormant {
    background-color: #f3f4f6;
    color: #374151;
}

/* 顧客セグメント分析カード */
.segment-card {
    transition: transform 0.2s ease;
}

.segment-card:hover {
    transform: translateY(-2px);
}

/* アクションフィルタースタイル */
.filter-btn {
    transition: all 0.2s ease;
    font-size: 12px;
    margin-bottom: 4px;
}

.filter-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-btn.active {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

/* アクションタグスタイル */
.action-tag {
    display: inline-block;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* サービス無効化スタイル */
select:disabled {
    background-color: #f3f4f6 !important;
    color: #9ca3af !important;
    cursor: not-allowed !important;
}

.pointer-events-none {
    pointer-events: none;
}

.opacity-50 {
    opacity: 0.5;
}

/* 見積書専用スタイル */
.quote-document {
    font-family: 'Noto Sans JP', 'MS Gothic', monospace;
    line-height: 1.4;
    color: #000;
}

.quote-document .header {
    border-bottom: 3px solid #1e40af;
    margin-bottom: 20px;
    padding-bottom: 15px;
}

.quote-document .quote-title {
    font-size: 24px;
    font-weight: bold;
    color: #1e40af;
}

.quote-document .info-table,
.quote-document .service-table,
.quote-document .summary-table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 20px;
}

.quote-document .info-table th,
.quote-document .info-table td,
.quote-document .service-table th,
.quote-document .service-table td,
.quote-document .summary-table th,
.quote-document .summary-table td {
    border: 1px solid #333;
    padding: 8px;
}

.quote-document .service-table th {
    background-color: #1e40af;
    color: white;
    font-weight: bold;
    text-align: center;
}

.quote-document .summary-table .total-row {
    background-color: #fef3c7;
    font-size: 16px;
    font-weight: bold;
}

.quote-document .notes {
    background-color: #f8fafc;
    border: 1px solid #d1d5db;
    padding: 15px;
    border-radius: 4px;
}

.quote-document .footer {
    border-top: 2px solid #1e40af;
    margin-top: 30px;
    padding-top: 15px;
    text-align: center;
}

/* 見積書印刷専用スタイル */
@media print {
    .quote-document {
        margin: 0;
        padding: 0;
        max-width: none;
        font-size: 12px;
    }
    
    .quote-document .service-table {
        font-size: 10px;
    }
    
    .quote-document .service-table th,
    .quote-document .service-table td {
        padding: 4px 2px;
    }
    
    .quote-document .summary-table {
        width: 50%;
        margin-left: auto;
    }
    
    @page {
        size: A4;
        margin: 15mm 10mm;
    }
    
    /* 改ページ制御 */
    .quote-document .header {
        page-break-after: avoid;
    }
    
    .quote-document .service-table,
    .quote-document .summary-table {
        page-break-inside: avoid;
    }
    
    .quote-document .notes {
        page-break-before: avoid;
    }
}