/* src/public/css/age-chart.css */

/* 💡 干支まとめカード */
.summary-section {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}
.summary-card {
    flex: 1;
    min-width: 250px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    position: relative;
    border-top: 4px solid #94a3b8;
    transition: transform 0.2s, box-shadow 0.2s;
}
.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}
.summary-card.last-year {
    border-top-color: #64748b;
}
.summary-card.this-year {
    border-top-color: #3b82f6; /* 今年の干支を目立たせる */
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}
.summary-card.next-year {
    border-top-color: #10b981;
}
.card-inner {
    padding: 20px;
    text-align: center;
}
.summary-label {
    font-size: 0.85rem;
    font-weight: bold;
    color: #64748b;
    display: block;
    margin-bottom: 8px;
}
.summary-card.this-year .summary-label {
    color: #2563eb;
}
.zodiac-val {
    font-size: 2rem;
    margin: 5px 0;
    color: #1e293b;
    font-weight: 800;
}
.animal-val {
    font-size: 0.95rem;
    color: #475569;
    margin: 0;
}

/* 💡 検索フォームセクション */
.search-section {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}
.section-label {
    font-size: 1.1rem;
    color: #2a5298;
    border-left: 4px solid #2a5298;
    padding-left: 10px;
    margin-bottom: 20px;
    font-weight: bold;
}
.search-tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
    gap: 5px;
}
.tab-btn {
    padding: 10px 20px;
    border: none;
    background: none;
    font-weight: bold;
    color: #64748b;
    cursor: pointer;
    border-radius: 6px 6px 0 0;
    transition: all 0.2s;
    font-size: 0.95rem;
}
.tab-btn:hover {
    color: #2a5298;
    background: #f8fafc;
}
.tab-btn.active {
    color: #2a5298;
    border-bottom: 3px solid #2a5298;
    margin-bottom: -2px;
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

/* フォーム入力欄のスタイリング */
.search-form-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}
.input-inline-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}
.input-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}
.input-inline label {
    font-size: 0.9rem;
    font-weight: bold;
    color: #475569;
}
.form-select, .form-input {
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background-color: #fff;
    font-size: 0.95rem;
    outline: none;
    box-sizing: border-box;
    height: 40px;
}
.form-select {
    min-width: 80px;
}
.form-input {
    width: 100px;
}
.unit {
    font-size: 0.9rem;
    color: #475569;
}
.btn-search {
    padding: 8px 24px;
    background-color: #2a5298;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
    height: 40px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.btn-search:hover {
    background-color: #1e3c72;
}

/* 💡 検索結果パネル */
.search-result-panel {
    margin-top: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    animation: fadeIn 0.3s ease-out;
}
.result-title {
    margin: 0 0 10px 0;
    color: #166534;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.result-content {
    font-size: 1.1rem;
    color: #1e293b;
    font-weight: bold;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}
.result-item {
    background: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #dcfce7;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
/* 💡 追加：範囲外を指定したときのエラー文（旧 JS 内のインライン指定から移動） */
.result-error {
    color: #ef4444;
}

/* 💡 早見表テーブル */
.table-section {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}
/* 💡 追加：表の見出し行（見出し＋並び順セレクト）。blade の style 属性から移動 */
.table-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}
.section-label-flat {
    margin-bottom: 0;
}
.sort-order-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.sort-order-label {
    font-size: 0.9rem;
    font-weight: bold;
    color: #475569;
}
.table-note {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: -15px;
    margin-bottom: 15px;
}
.table-responsive {
    max-height: 600px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    position: relative;
}
.age-chart-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    font-size: 0.95rem;
}
.age-chart-table th, .age-chart-table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
}
.age-chart-table th {
    background-color: #f1f5f9;
    color: #475569;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 1px 0 #cbd5e1;
}
.age-chart-table tr:nth-child(even) {
    background-color: #f8fafc;
}
.age-chart-table tr:hover {
    background-color: #f1f5f9;
}

/* 行のハイライト表示 */
.age-chart-table tr.highlight-row {
    background-color: #dbeafe !important;
    border: 2px solid #3b82f6;
    animation: highlightPulse 1.5s infinite;
}

/* 💡 アニメーション効果 */
@keyframes highlightPulse {
    0% {
        box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.5);
    }
    50% {
        box-shadow: inset 0 0 0 4px rgba(59, 130, 246, 0.8);
        background-color: #eff6ff !important;
    }
    100% {
        box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.5);
    }
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 💡 追加：タブレット〜スマートフォン（〜768px）対応
   4列の表と検索タブが画面幅からはみ出して横スクロールしていました */
@media (max-width: 768px) {
    .search-section,
    .table-section {
        padding: 18px;
    }
    /* タブは折り返して全部押せるようにする */
    .search-tabs {
        flex-wrap: wrap;
    }
    .tab-btn {
        padding: 10px 14px;
        font-size: 0.9rem;
    }
    /* 見出しと並び順セレクトは縦積みに */
    .table-header-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .sort-order-group {
        justify-content: space-between;
    }
    .sort-order-group .form-select {
        flex: 1;
        min-width: 0;
    }
    .table-note {
        margin-top: 0;
    }
    /* 表は文字と余白を詰めて4列を収める */
    .age-chart-table {
        font-size: 0.85rem;
    }
    .age-chart-table th,
    .age-chart-table td {
        padding: 8px 4px;
    }
    .table-responsive {
        max-height: 60vh;
        overflow-x: auto;
    }
    .form-input {
        width: 100%;
    }
    .summary-card {
        min-width: 0;
        flex: 1 1 100%;
    }
}

@media (max-width: 600px) {
    .search-form-group {
        flex-direction: column;
        align-items: stretch;
    }
    .input-inline-group {
        flex-direction: column;
        align-items: stretch;
    }
    .input-inline {
        justify-content: space-between;
    }
    .btn-search {
        width: 100%;
        justify-content: center;
    }
}
