/* Custom styles to complement Bootstrap */

/* 検索結果リストのリンクに指カーソルを強制適用 */
.list-group-item-action {
    display: block;
    width: 100%;
    cursor: pointer !important;
}

.upload-area {
    border: 2px dashed var(--bs-border-color);
    border-radius: 5px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: var(--bs-primary);
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

.receipt-info {
    border-left: 3px solid var(--bs-primary);
    padding-left: 1rem;
    margin-bottom: 1.5rem;
}

/* 更新された行のハイライト表示 */
.updated-row {
    background-color: rgba(25, 135, 84, 0.15);
    transition: background-color 1s ease;
}

.updated-row td {
    animation: highlight-fade 3s ease;
}

@keyframes highlight-fade {
    0% { background-color: rgba(25, 135, 84, 0.3); }
    100% { background-color: transparent; }
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--bs-secondary);
}

.progress-container {
    display: none;
    margin: 2rem 0;
}

.result-section {
    margin: 1.5rem 0;
    padding: 1rem;
    border-radius: 5px;
    background-color: rgba(var(--bs-dark-rgb), 0.2);
}

.line-items-table {
    margin-top: 1rem;
}

.invoice-valid {
    color: var(--bs-success);
}

.invoice-invalid {
    color: var(--bs-danger);
}

/* 複数税率表示のスタイル */
.tax-subrow {
    border-top: none !important;
}

.tax-subrow-cell {
    border-left: 3px solid #6c757d;
    background-color: rgba(0, 0, 0, 0.02);
    font-size: 0.95em;
    position: relative;
}

/* 同じレシートグループのスタイル */
tr.receipt-row.tax-subrow + tr:not(.tax-subrow) {
    border-top: 2px solid #dee2e6; /* 異なるレシート間の区切り線 */
}

/* レシートグループのホバー効果 */
tr.receipt-row:hover,
tr.receipt-row:hover + tr.tax-subrow,
tr.tax-subrow:hover,
tr.tax-subrow:hover + tr.tax-subrow {
    background-color: rgba(13, 110, 253, 0.08);
}

/* 税率バッジのスタイル */
.badge.bg-info {
    background-color: #17a2b8 !important;
    color: #ffffff !important;
}
.badge.bg-success {
    background-color: #28a745 !important;
}

.export-options {
    margin-top: 2rem;
}

.btn-export {
    margin-right: 0.5rem;
}

/* レシートプレビュー関連のスタイルを削除 */
.receipt-preview-container {
    position: relative;
    width: 100%;
    min-height: 400px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
    padding: 10px;
    margin-bottom: 15px;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.receipt-preview-img {
    max-height: 350px !important;
    width: auto !important;
    object-fit: contain !important;
    margin: 0 auto;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .upload-area {
        padding: 1rem;
    }
    
    .btn-export {
        margin-bottom: 0.5rem;
        width: 100%;
    }
}


/* フォルダカード全体クリックUX向上用 */
.folder-card-link {
  display: block;
  color: inherit;
  cursor: pointer;
  transition: box-shadow 0.2s, background 0.2s;
}
.folder-card-link:hover .card {
  background: #f5f7fa;
  box-shadow: 0 0 0 2px #0d6efd33;
}

/* AI推奨ポップアップのアニメーション */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateY(-5px);
    }
    20% {
        opacity: 1;
        transform: translateY(0);
    }
    80% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-5px);
    }
}

/* AI推奨ポップアップのスタイル */
.ai-recommendation-popup {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ai-recommendation-popup:hover {
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
}
