body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}
.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 10px;
}
.task-panel {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow: hidden;
}
.panel-header {
    padding: 15px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
}
.panel-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}
.back-button {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #4285f4;
    padding: 5px 10px;
    display: none;
}
.add-button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
}
.task-list {
    padding: 0;
    margin: 0;
    list-style: none;
}
.task-item {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
}
.task-item:last-child {
    border-bottom: none;
}
.task-item:active {
    background-color: #f9f9f9;
}
.task-checkbox {
    margin-right: 10px;
    width: 20px;
    height: 20px;
}
.task-text {
    flex-grow: 1;
    font-size: 16px;
}
.task-menu {
    cursor: move;
    user-select: none;
    padding: 5px 10px;
    font-size: 16px;
    color: #777;
    display: flex;
    align-items: center;
    justify-content: center;
}
.drag-handle {
    display: inline-block;
    font-size: 18px;
    line-height: 1;
    color: #777;
    user-select: none;
}
.task-menu:active {
    opacity: 1;
}
.task-menu.dragging {
    color: #007bff;
    background-color: rgba(0, 123, 255, 0.1);
    border-radius: 4px;
    transform: scale(1.05);
    transition: transform 0.1s ease-out;
}
.completed-task {
    background-color: #f8f8f8;
    opacity: 0.8;
}
.completed-task .task-text {
    text-decoration: line-through;
    color: #777;
}
.task-divider {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    margin: 10px 0;
}
.divider-line {
    flex-grow: 1;
    height: 1px;
    background-color: #ddd;
}
.divider-text {
    padding: 0 10px;
    color: #888;
    font-size: 14px;
}
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 100;
    align-items: center;
    justify-content: center;
}
.modal-content {
    background-color: white;
    padding: 20px;
    padding-bottom: 50px;
    width: 80%;
    max-width: 400px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    text-align: center;
    animation: popup 0.3s ease-out;
    position: relative;
    overflow: hidden;
}
.close-button {
    float: right;
    cursor: pointer;
    font-size: 20px;
}
.task-detail {
    padding: 15px;
}
.task-detail-header {
    background-color: #e8f0fe;
    padding: 15px;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.task-name {
    font-size: 18px;
    margin: 0;
}
.task-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.delete-button {
    border: none;
    background: none;
    cursor: pointer;
    color: #777;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}
.calendar {
    margin-top: 20px;
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.calendar-year {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}
.month {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}
.month-name {
    font-size: 14px;
    color: #777;
    margin-right: 10px;
    width: 35px;
}
.day-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16px, 1fr));
    gap: 3px;
    flex-grow: 1;
    max-width: 100%;
    overflow: hidden;
}
.day {
    width: 16px;
    height: 16px;
    background-color: #eee;
    border-radius: 2px;
}
.day.completed {
    background-color: #4285f4;
}
.sortable-placeholder {
    border: 1px dashed #ccc;
    background-color: #f9f9f9;
    height: 60px;
    margin-bottom: 10px;
    list-style: none;
    border-radius: 8px;
}
.login-container {
    max-width: 500px;
    margin: 10% auto;
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}
.login-form {
    margin-top: 20px;
}
.login-input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 16px;
}
.login-button {
    background-color: #4285f4;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    font-size: 16px;
    width: 100%;
}
.user-url {
    margin-top: 20px;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 4px;
    word-break: break-all;
    font-size: 14px;
}
.copy-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    width: 100%;
    font-size: 16px;
}
.user-info {
    font-size: 12px;
    color: #666;
    margin-top: 10px;
    text-align: center;
    padding: 10px;
}

/* フォーム要素のスタイル */
#newTaskName {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    box-sizing: border-box;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#addTaskForm button[type="submit"] {
    width: 100%;
    padding: 12px;
    background-color: #4285f4;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

#confirmDelete {
    flex: 1;
    padding: 12px;
    background-color: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

#cancelDelete {
    flex: 1;
    padding: 12px;
    background-color: #ccc;
    color: black;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.button-group {
    display: flex;
    gap: 10px;
}

/* モバイル用の画面切り替え */
#taskListView, #taskDetailView {
    transition: all 0.3s;
}
#taskDetailView {
    display: none;
}
.is-detail-view #taskListView {
    display: none;
}
.is-detail-view #taskDetailView {
    display: block;
}
.is-detail-view .back-button {
    display: block;
}

.task-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.edit-button {
    border: none;
    background: none;
    cursor: pointer;
    color: #777;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

#editTaskName {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    box-sizing: border-box;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#editTaskForm button[type="submit"] {
    width: 100%;
    padding: 12px;
    background-color: #4285f4;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

/* 達成おめでとうモーダル */
#congratsModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 100;
    transition: opacity 0.8s ease;
}

.congrats-modal-content {
    background-color: white;
    margin-top: 15%;
    margin-left: auto;
    margin-right: auto;
    padding: 20px;
    padding-bottom: 50px;
    width: 80%;
    max-width: 400px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    text-align: center;
    animation: popup 0.3s ease-out;
}

@keyframes popup {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.congrats-title {
    font-size: 24px;
    font-weight: bold;
    color: #4285f4;
    margin-bottom: 15px;
    margin-left: auto;
    margin-right: auto;
}

.congrats-illustration {
    width: 150px;
    height: 150px;
    margin: 15px auto;
}

.congrats-btn {
    background-color: #4285f4;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 15px;
}

/* 全てのタスク完了表示スタイル */
.all-completed {
    padding: 20px;
    text-align: center;
}

.all-completed-message {
    background-color: #ffffff;
    padding: 20px;
    margin: 10px 0;
}

.all-completed-message h3 {
    color: #333333;
    font-size: 16px;
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: normal;
}

.completed-illustration {
    margin: 15px auto;
    padding: 10px;
}

.completed-illustration img {
    max-width: 100%;
    opacity: 0.9;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0);
    }
}

/* タスク0件表示のスタイル */
.empty-tasks {
    padding: 20px;
    text-align: center;
}

.empty-tasks-message {
    background-color: #ffffff;
    padding: 20px;
    margin: 10px 0;
}

.empty-tasks-message h3 {
    color: #757575;
    font-size: 16px;
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: normal;
}

.empty-illustration {
    margin: 15px auto;
    padding: 10px;
}

.empty-illustration img {
    max-width: 100%;
    opacity: 0.9;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
    100% {
        transform: translateY(0);
    }
}

/* スマホ向け調整 */
@media (max-width: 768px) {
    .task-menu {
        padding: 8px 12px;
        touch-action: none;
        -webkit-user-select: none;
        user-select: none;
        height: 44px;
        width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .drag-handle {
        font-size: 20px;
        pointer-events: none;
    }
    
    .month {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .month-name {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .day-grid {
        grid-template-columns: repeat(auto-fill, minmax(14px, 1fr));
        width: 100%;
    }
    
    .day {
        width: 14px;
        height: 14px;
    }
    
    .task-item {
        -webkit-tap-highlight-color: transparent;
    }
    
    .task-menu.dragging {
        background-color: #e0e0e0;
        border-radius: 50%;
        transform: scale(1.1);
    }
}

/* タスクドラッグ中のスタイル */
.ui-sortable-helper {
    background-color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    opacity: 0.9;
    border-radius: 8px;
    z-index: 10000;
    transform: scale(1.02);
    transition: transform 0.1s ease;
    touch-action: none;
    pointer-events: none;
}

.list-chart-button {
    background: none;
    border: none;
    cursor: pointer;
    color: #777;
    padding: 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.list-chart-button:hover {
    background-color: rgba(200, 200, 200, 0.2);
}

.chart-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    margin: 0 5px;
    border-radius: 4px;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.chart-button:hover {
    background-color: rgba(200, 200, 200, 0.2);
}

#taskChartContainer {
    min-height: 300px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.chart-loading {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.chart-container {
    margin-top: 20px;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 10px;
}

.chart-header {
    text-align: center;
    margin-bottom: 15px;
}

.chart-bars {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 220px;
    padding: 0 10px;
    min-width: 500px;
}

.chart-bar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 5px;
    width: 40px;
}

.chart-bar {
    width: 30px;
    background-color: #4a90e2;
    border-radius: 4px 4px 0 0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 12px;
    transition: height 0.5s ease;
}

.chart-label {
    margin-top: 5px;
    font-size: 12px;
    text-align: center;
}

.error {
    color: #e74c3c;
    text-align: center;
    padding: 20px;
}

/* ドラッグ中にボディのスクロールを防止 */
body.ui-sortable-dragging {
    overflow: hidden;
}

.sortable-placeholder {
    background-color: rgba(200, 200, 200, 0.3);
    border: 1px dashed #aaa;
    visibility: visible !important;
    height: 50px;
    margin: 5px 0;
    border-radius: 8px;
}

/* モバイルデバイス向けスタイル */
.touch-device .task-item .fa-bars {
    padding: 10px;
    font-size: 1.2em;
    color: #4a6da7;
    cursor: grab;
}

.touch-device .task-item {
    touch-action: pan-y;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.2s ease;
}

.touch-device .task-item.dragging {
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    background-color: #f8f8f8;
}

.mobile-hint {
    background-color: rgba(74, 109, 167, 0.9);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    margin: 10px 0;
    text-align: center;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.mobile-hint i {
    margin: 0 3px;
    font-size: 16px;
}

/* アニメーションの対応 */
@media (prefers-reduced-motion: no-preference) {
    .touch-device .task-item {
        transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
        will-change: transform;
    }
}

@media (max-width: 768px) {
    .mobile-hint {
        font-size: 13px;
        padding: 8px 12px;
    }
}

/* 通知スタイル */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: 500;
    color: #fff;
    background-color: #4c6ef5;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.notification.show {
    opacity: 1;
    transform: translateY(0);
}

.notification.success {
    background-color: #40c057;
}

.notification.warning {
    background-color: #fd7e14;
}

.notification.error {
    background-color: #fa5252;
}

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

.slide-in {
    animation: slideIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-20px); }
    to { transform: translateY(0); }
}

/* ドラッグ中のタスクアイテムスタイル */
.task-item.dragging {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    z-index: 100;
    background-color: #f8f9fa;
    transition: transform 0.05s ease-out, box-shadow 0.2s ease;
}

/* タスクリスト更新中のビジュアル効果 */
.task-list.updating {
    position: relative;
}

.task-list.updating::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.5);
    z-index: 10;
}

/* タスク完了モーダルのスタイル */
#congratsModal img {
    width: 200px;
    height: 200px;
    display: block;
    margin: auto;
    object-fit: contain;
}

/* 完了モーダルのOKボタンを非表示にする */
#closeCongrats, .congrats-btn {
    display: none;
} 