body {
    margin: 0;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #f4f4f9;
}

/* 通知メッセージシステム */
.notification-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.notification {
    background: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
    max-width: 500px;
    animation: slideDown 0.3s ease-out;
    pointer-events: auto;
}

.notification.success {
    border-left: 4px solid #28a745;
    background: linear-gradient(90deg, rgba(40, 167, 69, 0.1) 0%, white 100%);
}

.notification.error {
    border-left: 4px solid #dc3545;
    background: linear-gradient(90deg, rgba(220, 53, 69, 0.1) 0%, white 100%);
}

.notification.info {
    border-left: 4px solid #007bff;
    background: linear-gradient(90deg, rgba(0, 123, 255, 0.1) 0%, white 100%);
}

.notification.warning {
    border-left: 4px solid #ffc107;
    background: linear-gradient(90deg, rgba(255, 193, 7, 0.1) 0%, white 100%);
}

.notification-icon {
    font-size: 20px;
}

.notification-message {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.notification.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

#sections {
    display: flex;
    width: 100%;
    gap: 0;
    align-items: flex-start;
    box-sizing: border-box;
    flex-wrap: wrap;
}
#sections > section {
    flex: 1 1 25%;
    min-width: 280px;
    padding: 0 8px;
    box-sizing: border-box;
    border-right: 1px solid #ccc;
    min-height: 100vh;
}

/* 今日のタスク履歴セクション（一番左、固定幅450px） */
#sections > section#today-history {
    flex: 0 0 450px;
    width: 450px;
    min-width: 250px;
}
#sections > section:last-child {
    border-right: none;
}

/* 今日のタスク履歴用スタイル */
.today-history-container {
    padding: 10px;
}

#today-timeline {
    position: relative;
    background: linear-gradient(to bottom, #f9f9f9 0%, #f5f5f5 100%);
    border: 1px solid #ddd;
    border-radius: 8px;
}

/* 時刻表示用の背景線 */
.hour-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: #e0e0e0;
    z-index: 1;
}

.hour-line.current-time {
    background: #ff4444;
    height: 2px;
    z-index: 10;
}

.hour-label {
    position: absolute;
    left: 5px;
    font-size: 10px;
    color: #999;
    background: white;
    padding: 0 3px;
    z-index: 2;
}

/* タスク履歴のプロット */
.task-history-plot {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    padding: 2px 4px;
    max-width: 80px;
}

.task-history-plot:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #00bcd4;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.task-plot-tag {
    flex-shrink: 0;
}

.task-plot-score {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    #sections {
        flex-direction: column;
    }
    #sections > section {
        border-right: none;
        border-bottom: 1px solid #ccc;
        padding: 5px 0; /* 10px → 5px に削減 */
        flex: 1 1 auto;
        min-height: auto; /* デスクトップの100vhを無効化 */
    }
    #sections > section:last-child {
        border-bottom: none;
    }
}

.container {
    column-width: 350px;
    column-gap: 20px;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .container {
        column-width: 100%;
        column-count: 1;
        padding: 10px; /* 20px → 10px に削減 */
    }
    
    /* 今日のタスク履歴もモバイル対応 */
    .today-history-container {
        padding: 5px; /* 10px → 5px に削減 */
    }
    
    #today-timeline {
        height: 300px; /* モバイルでは高さを削減 */
    }
    
    /* セクションヘッダーの余白も調整 */
    .section-header {
        padding: 0 10px; /* 20px → 10px に削減 */
    }
}

.category {
    break-inside: avoid;
    display: inline-block;
    width: 100%;
    margin-bottom: 20px;
    background: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    vertical-align: top;
}
.category:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.category[draggable="true"] {
    cursor: move;
}

.drop-zone {
    width: 100%;
    min-height: 5px;
    margin: -2px 0;
    padding: 0;
    display: block;
    transition: all 0.3s ease;
    position: relative;
    break-inside: avoid;
    background: transparent;
    font-size: 0;
    line-height: 0;
}

.drop-zone-active {
    display: block;
    height: 40px;
    background: linear-gradient(to bottom, transparent, #00bcd4, transparent);
    border: 2px dashed #00bcd4;
    border-radius: 8px;
    margin: 10px 0;
}

.drop-zone-active::after {
    content: "ここに挿入";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #00838f;
    font-size: 12px;
    font-weight: bold;
}


.category.no_display {
    display:none;
}

.category.x_small {
    min-width: 200px;
}
.category.y_small {
    height: 150px;
}

.category.x_medium {
    min-width: 300px;
}
.category.y_medium {
    height: 300px;
}

.category.x_large {
    min-width: 400px;
}
.category.y_large {
    height: 450px;
}

.title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.title {
    font-size: 1.2em;
    font-weight: bold;
    flex-grow: 1;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.title-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-score {
    font-size: 0.7em;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 10px;
    background: #6c757d;
    color: #fff;
    flex-shrink: 0;
}
.card-score.positive {
    background: #28a745;
}
.card-score.negative {
    background: #dc3545;
}

.task-score {
    font-size: 0.7em;
    font-weight: bold;
    padding: 1px 6px;
    border-radius: 8px;
    color: #fff;
    background: #6c757d;
    margin-left: 6px;
    flex-shrink: 0;
}
.task-score.positive {
    background: #28a745;
}
.task-score.negative {
    background: #dc3545;
}

.title:hover {
    background: #f0f0f0;
}

.add-button-title {
    background: #00bcd4;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.3s ease;
}

.add-button-title:hover {
    background: #00838f;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    margin-bottom: 0;
}

.section-header h2 {
    margin: 0;
}

.section-add-button {
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.section-add-button:hover {
    background: #45a049;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: calc(100% - 60px); /* Adjust dynamically based on available space */
    overflow-y: auto; /* Enable vertical scrolling */
}

ul li {
    font-size: 0.8em;
    background: #f9f9f9;
    margin: 2px 0;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
    min-height: 24px;
    cursor: default;
}

ul li:hover {
    background: #f0f8ff;
    border-color: #c3d9ff;
}

ul li[disabled] {
    background: #f4f4f4;
    border-color: #ccc;
    color: #aaa;
    cursor: not-allowed;
}

ul li.attention {
    background: #e0f7fa;
    border-color: #00bcd4;
}

ul li span {
    padding: 5px;
    text-align: left;
}

.edit-button {
    background: transparent;
    border: 1px solid #ddd;
    color: #666;
    border-radius: 3px;
    width: 20px;
    height: 20px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
    transition: all 0.2s ease;
}

.edit-button:hover {
    border-color: #00bcd4;
    color: #00bcd4;
    background: #f0f9ff;
}

.remove-button {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 14px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-button:hover {
    color: #d32f2f;
}

ul li .checkbox {
    margin-right: 8px;
}

.attention-badge {
    background: transparent;
    border: 1px solid #ddd;
    color: #999;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    transition: all 0.2s ease;
    font-weight: bold;
}

.attention-badge:hover {
    border-color: #00bcd4;
    color: #00bcd4;
}

.attention-badge.active {
    background: #00bcd4;
    border-color: #00bcd4;
    color: white;
}

.task-item {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 6px 10px !important;
    background: #f9f9f9 !important;
    border: 1px solid #ddd !important;
    border-radius: 5px !important;
}

.task-item.attention {
    background: #e0f7fa !important;
    border-color: #00bcd4 !important;
}

.task-left-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

.task-title {
    flex: 1;
    text-align: left;
    padding: 2px 0;
    display: flex;
    align-items: center;
    gap: 0px;
    font-size: 1.15em;
}

.task-right-container {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* タグ別色分け（タスク行 / タイムラインプロット共通） */
.task-item.tag-habit {
    border-left: 4px solid #28a745;
}
.task-item.tag-task {
    border-left: 4px solid #007bff;
}
.task-item.tag-memo {
    border-left: 4px solid #6c757d;
}

.task-plot-tag {
    background: #e9ecef;
    color: #333;
}
.task-plot-tag.tag-habit {
    background: #28a745;
    color: #fff;
}
.task-plot-tag.tag-task {
    background: #007bff;
    color: #fff;
}
.task-plot-tag.tag-memo {
    background: #6c757d;
    color: #fff;
}

/* タスク作成・編集ポップアップのカテゴリ（タグ）ラジオ */
.tag-radio-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 4px;
}
.tag-radio-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    background: #fff;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.tag-radio-label input[type="radio"] {
    margin: 0;
    cursor: pointer;
}
.tag-radio-label:has(input:checked).tag-habit {
    background: #28a745;
    color: #fff;
    border-color: #28a745;
}
.tag-radio-label:has(input:checked).tag-task {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}
.tag-radio-label:has(input:checked).tag-memo {
    background: #6c757d;
    color: #fff;
    border-color: #6c757d;
}

#datetime-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 100px;
    color: rgba(0, 0, 0, 0.1); /* 薄い文字色と透明度 */
    pointer-events: none; /* マウス操作を透過 */
    z-index: 9999; /* 最前面に表示 */
    text-align: center;
    white-space: nowrap;
}
@media (max-width: 768px) {
    #datetime-overlay {
        display: none;
    }
}

/* ポップアップスタイル */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.popup-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.popup-content h3 {
    margin: 0 0 16px 0;
    font-size: 1.4em;
    color: #333;
}

.task-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 20px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.task-input:focus {
    outline: none;
    border-color: #00bcd4;
}

.popup-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.popup-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.popup-buttons button:first-child {
    background: #00bcd4;
    color: white;
}

.popup-buttons button:first-child:hover {
    background: #00838f;
}

.popup-buttons button:last-child {
    background: #f5f5f5;
    color: #666;
}

.popup-buttons button:last-child:hover {
    background: #e0e0e0;
}

.delete-button {
    background: #f44336 !important;
    color: white !important;
}

.delete-button:hover {
    background: #d32f2f !important;
}

/* フォーム要素のスタイル */
.popup-content label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.form-group {
    margin-bottom: 16px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-container input[type="checkbox"] {
    margin: 0;
}

.checkbox-container label {
    margin-bottom: 0;
    font-weight: normal;
    cursor: pointer;
}

.score-input {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.score-input:focus {
    outline: none;
    border-color: #00bcd4;
}

.type-select, .size-select {
    width: 100%;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.type-select:focus, .size-select:focus {
    outline: none;
    border-color: #00bcd4;
}


