/* -----------------------
基本設定
------------------------ */
body {
    font-family: "Hiragino Kaku Gothic ProN", Meiryo, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #f0f4f8, #dfe9f3);
    margin: 0;
    padding: 1rem;
    height: 100vh;
}

.container {
    max-width: 1200px;
    margin: auto;
}

#wrap {
    clear: both;
    width: 50%;
    margin: 0 auto;
}

#content
{
    padding:50px;
}

/* -----------------------
タイポグラフィ
------------------------ */
h1 {
    font-size: 2rem !important;
}

h3 {
    font-size: 2rem;
    padding: 50px 0 0 20px;
}

.category-title,
.task-category-title
{
    cursor: pointer;
}

.login_info {
    font-size: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px;
}

/* -----------------------
カラーバリエーション
------------------------ */
.bg-red-light   { border-bottom: 10px solid #F00; padding: 20px 50px 0; }
.bg-green-light { border-bottom: 10px solid #0F0; padding: 20px 50px 0; }
.bg-blue-light  { border-bottom: 10px solid #00F; padding: 20px 50px 0; }

/* -----------------------
ナビ・トップバー
------------------------ */
.top-bar a {
    color: #000;
}
.top-bar a:hover {
    opacity: 0.7;
}
.top-bar ul {
    background-color: transparent !important;
}

/* -----------------------
カードデザイン
------------------------ */
.card {
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover,
.card:active {
    transform: scale(1.03);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}
.card-link:hover .card {
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
    transform: translateY(-3px);
    transition: all 0.2s ease-in-out;
}

.card-link .card {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0;
}

.card-link .card .card-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
}

.card .card-section i {
    color: #9a9;
}

/* -----------------------
モバイル対応
------------------------ */
@media (max-width: 1024px) {
    h1 { font-size: 3.5rem !important; }
    h3 { font-size: 3rem}
    .header_button { font-size: 3rem; }
    ul.menu li { margin-bottom: 10px; margin-right: 20px; }

    .login_info { font-size: 2rem; }

    .card {
        aspect-ratio: 1 / 1;
        margin-bottom: 0.75rem;
    }

    .card .card-section {
        padding: 0.6rem;
    }

    .card .card-section i { font-size: 8.2rem; }
    .card .card-section p {
        font-size: 1.5rem;
        font-weight: 600;
        margin-top: 0.3em;
    }
}

@media (max-width: 480px) {
    h1 { font-size: 1.4em; }
    input, button { font-size: 0.95em; }
}

/* -----------------------
ボタン共通
------------------------ */
button, .btn-task, .field-selection button, .field-buttons button, .plot-buttons button, .action-buttons button, .btn-red, .btn-orange, .cropButtons, .varietyButtons {
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s ease;
    padding:5px 10px;
    border:1px solid #666;
}

.btn-add,
.field-selection button,
.field-buttons button,
.plot-buttons button, 
.cropButtons button, 
.varietyButtons button {
    border: 1px solid #ccc;
    background: #f8f8f8;
    padding: 0.3-0.6rem;
}

.field-selection button.active,
.field-buttons button.active,
.plot-buttons button.active, 
.cropButtons button.active,
.varietyButtons button.active
{
    background: #4CAF50;
    color: white;
    border-color: #388e3c;
}

.btn-add,
.field-selection button:hover,
.field-buttons button:hover,
.plot-buttons button:hover, 
.cropButtonsbutton:hover,
.varietyButtons button:hover,
{
    background: #e0e0e0;
}

.btn-add
{
    padding:5px 10px;
}

.button-container button {
    margin: 3px;
    padding: 5px 10px;
    border: 1px solid #666;
    border-radius: 4px;
    background-color: #eee;
    cursor: pointer;
}

.button-container button.active {
    background-color: #5cb85c;
    color: #fff;
    border-color: #4cae4c;
}

.btn-delete { background: #d32f2f; color: white; }
.btn-delete:hover { background: #b71c1c; }

/* -----------------------
フィールド・区画ボタン
------------------------ */
.field-selection { margin-bottom: 20px; }
.field-selection button { padding: 8px 16px; margin-right: 8px; }
.field-buttons button, .plot-buttons button { margin: 0.2rem; padding: 0.3rem 0.6rem; font-size: 0.9rem; }

/* -----------------------
モーダル
------------------------ */
.modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.4);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    min-width: 400px;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

/* -----------------------
タスクボタン
------------------------ */
.task-category-group { margin-bottom: 1em; }
.task-category-title {
}
.task-button-list { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-task {
    background-color: #f2f2f2;
    border: 1px solid #ccc;
    padding: 6px 10px;
}
.btn-task:hover { background-color: #e0f7e0; }
.btn-task.selected {
    background-color: #4caf50;
    color: white;
    border-color: #388e3c;
    box-shadow: 0 0 3px rgba(0,0,0,0.2);
}

.btn-batch
{
    margin:10px 5px;
}

/* -----------------------
テーブル・WBS
------------------------ */
table, .wbs-table {
    width: 100%;
    border-collapse: collapse;
}
th, td, .wbs-table th, .wbs-table td {
    border: 1px solid #ccc;
    padding: 0.5rem;
    text-align: center;
    font-size: 0.9rem;
}
.bed-title { background: #c8e6c9; font-weight: bold; padding: 0.5rem; text-align: left; }
th { background: #e8f5e9; font-weight: bold; }

.wbs-bar {
    height: 20px;
    margin: 2px 0;
    color: white;
    font-size: 12px;
    text-align: center;
    line-height: 20px;
    cursor: pointer;
}
.wbs-layer { pointer-events: none; }

/* -----------------------
ページネーション・月選択
------------------------ */
#pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
#pagination span { margin: 0 5px; }

.month-selector { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.month-btn {
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #f8f8f8;
    cursor: pointer;
    font-size: 12px;
}
.month-btn.active { background: #28a745; color: white; }

/* -----------------------
汎用ユーティリティ
------------------------ */
.toggle-icon { display: inline-block; transition: transform 0.2s; }
.toggle-icon.open { transform: rotate(90deg); }

#toggleAll {
    border-radius: 8px;
    padding: 0.4rem 1rem;
    font-weight: bold;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    background-color: #fff;
    border: 1px solid #666;
}
#toggleAll:hover {
    background-color: #eee;
    color: #666;
    transform: translateY(-2px);
}
#toggleAll i { margin-right: 0.3rem; }

/* -----------------------
タイムピッカー
------------------------ */
.timeline {
    position: relative;
    width: 100%;
    height: 30px;
    background: #eee;
    margin: 5px 0;
    border-radius: 4px;
}
.time-range {
    position: absolute;
    height: 100%;
    background: #4caf50;
    left: 0;
    width: 60px; /* 初期幅1時間 */
    cursor: grab;
}


/* -----------------------
タスクカード
------------------------ */
.btn-task-card { cursor: pointer; }
.btn-task-card.selected { border: 2px solid #28a745; background-color: #eafaf1; }
.menu-title { margin-top: 10px; font-weight: bold; }
.hover-card:hover { box-shadow: 0 4px 8px rgba(0,0,0,0.2); }

/* タスクカード内 アイコンと文字を中央揃え */
.btn-task-card .card-section {
    display: flex;
    flex-direction: column;
    justify-content: center; /* 縦中央 */
    align-items: center;     /* 横中央 */
    text-align: center;
    height: 100%;            /* 高さいっぱいにする */
    padding: 1rem;
}

.btn-task-card i {
    margin-bottom: 0.5rem; /* アイコンと文字の間隔 */
    font-size: 2rem;
}

.btn-task-card .menu-title {
    font-weight: bold;
}

/* -----------------------
作付け計画関連
------------------------ */
.bed-block table th {
    text-align: center;
}

.btn-status {
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    border-radius: 4px;
}
.btn-status.active {
    background-color: #006699; /* 緑系にして計画中/実施済みを色で差別化 */
    color: #fff;
}

.btn-red {
    background-color: #e74c3c; /* 赤 */
    color: #fff;
}

.btn-orange {
    background-color: #f39c12; /* オレンジ */
    color: #fff;
}

.btn-blue {
    background-color: #069; /* 青 */
    color: #fff;
}

/* 既存 btn-xxx と同じ padding, border-radius, cursor を適用 */
.btn-red, .btn-orange {
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.crop-variety-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.crop-variety-buttons button {
    padding: 0.4rem 0.8rem;
    border: 1px solid #ccc;
    background-color: #f5f5f5;
    cursor: pointer;
    border-radius: 4px;
}

.crop-variety-buttons button.active {
    color: white;
}

#cropButtons button.active,
#batchCropButtons button.active,
#editCropButtons button.active {
    background-color: #4CAF50;
}

#varietyButtons button.active,
#batchVarietyButtons button.active,
#editVarietyButtons button.active {
    background-color: #2196F3;
    border-color: #1976D2;
}

#modalBatchPlan {
    display: none;             /* 初期は非表示 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;              /* 画面全体 */
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#modalBatchPlan .modal-content {
    background: #fff;
    padding: 20px;
    max-height: 80%;           /* 高さ上限 */
    width: 600px;              /* 任意 */
    overflow-y: auto;          /* 縦スクロール有効 */
    border-radius: 8px;
}

/* -----------------------
簡易がんと
------------------------ */

.gantt-chart-wrapper {
    overflow-x:auto;
    border:1px solid #ccc;
    padding:5px;
    position:relative;
}

.gantt-chart {
    display:grid;
    grid-template-columns: repeat(12, 100px); /* 月12列 */
    grid-auto-rows: 30px;
    gap: 2px;
    height: 400px;
    position:relative;
}

.gantt-row {
    display:flex;
    align-items:center;
    height:30px;
}

.gantt-cell {
    border:1px solid #eee;
    position:relative;
    width:100px;
    height:100%;
}

.gantt-bar {
    position:absolute;
    height:20px;
    top:5px;
    left:0;
    background-color:#4CAF50;
    color:#fff;
    font-size:12px;
    text-align:center;
    border-radius:3px;
    cursor:pointer;
    overflow:hidden;
    white-space:nowrap;
}

.gantt-bar.planed { background-color: #4CAF50; }
.gantt-bar.executed { background-color: #2196F3; }
.gantt-bar.end { background-color: #9E9E9E; }

.gantt-status-tab.active {
    background-color:#4CAF50;
    color:#fff;
}

.gantt-popup {
    min-width:150px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* 簡易ガント用スタイル */
.gantt-row { display:flex; gap:8px; align-items:center; padding:6px 0; border-bottom:1px solid #f0f0f0; }
.gantt-bedname { width:160px; flex:0 0 160px; font-weight:600; font-size:13px; }
.gantt-timeline { position:relative; flex:1; height:36px; background:#fafafa; border-radius:4px; overflow:visible; }
.gantt-month-cell { display:inline-block; width:16.6666667%; height:100%; box-sizing:border-box; border-left:1px dashed rgba(0,0,0,0.03); text-align:center; font-size:12px; padding-top:2px; color:#666; }
.gantt-bar {
    position:absolute;
    top:4px;
    height:28px;
    border-radius:4px;
    padding:4px 6px;
    box-sizing:border-box;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    font-size:12px;
    color:#fff;
}
.gantt-bar.multiple { opacity:0.95; }
.gantt-bar .label { font-weight:600; font-size:12px; background: none;}
.gantt-empty { color:#999; padding:8px 0; }


