/* リセットとベース設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* ヘッダー */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
}

.header h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header h1 i {
    margin-right: 15px;
    color: #ffd700;
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    font-weight: 300;
}

/* メインコンテンツ */
.main-content {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 20px;
}

/* タスク追加セクション */
.add-task-section {
    padding: 30px;
    background: linear-gradient(135deg, #f8f9ff 0%, #e8f2ff 100%);
    border-bottom: 1px solid #e1e8ed;
}

.input-group {
    display: flex;
    gap: 15px;
    align-items: center;
}

#taskInput {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

#taskInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#taskInput::placeholder {
    color: #9ca3af;
}

.btn {
    padding: 15px 25px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

/* フィルターセクション */
.filter-section {
    padding: 20px 30px;
    border-bottom: 1px solid #e1e8ed;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 20px;
    border: 2px solid #e1e8ed;
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #6b7280;
}

.filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.filter-btn i {
    margin-right: 5px;
}

/* タスクリストセクション */
.tasks-section {
    min-height: 300px;
}

.task-list {
    padding: 20px;
}

.task-item {
    display: flex;
    align-items: center;
    padding: 20px;
    margin-bottom: 15px;
    background: white;
    border: 1px solid #e1e8ed;
    border-radius: 15px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.task-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.task-item.completed {
    opacity: 0.7;
    background: #f8f9fa;
}

.task-item.completed .task-text {
    text-decoration: line-through;
    color: #9ca3af;
}

.task-checkbox {
    width: 24px;
    height: 24px;
    margin-right: 15px;
    cursor: pointer;
    accent-color: #667eea;
}

.task-text {
    flex: 1;
    font-size: 1rem;
    color: #374151;
    line-height: 1.5;
}

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

.btn-edit, .btn-delete {
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.btn-edit {
    background: #f0f9ff;
    color: #0369a1;
}

.btn-edit:hover {
    background: #0369a1;
    color: white;
}

.btn-delete {
    background: #fef2f2;
    color: #dc2626;
}

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

/* 空の状態 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #6b7280;
}

.empty-state p {
    font-size: 1rem;
    color: #9ca3af;
}

/* 統計セクション */
.stats-section {
    padding: 20px 30px;
    background: #f8f9ff;
    border-top: 1px solid #e1e8ed;
}

.stats-container {
    display: flex;
    justify-content: space-around;
    gap: 20px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
}

/* 編集モード */
.task-item.editing .task-text {
    display: none;
}

.task-item.editing .task-actions {
    display: none;
}

.task-edit-input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #667eea;
    border-radius: 8px;
    font-size: 1rem;
    margin-right: 10px;
}

.edit-actions {
    display: flex;
    gap: 10px;
}

.btn-save, .btn-cancel {
    padding: 8px 15px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
}

.btn-save {
    background: #10b981;
    color: white;
}

.btn-save:hover {
    background: #059669;
}

.btn-cancel {
    background: #6b7280;
    color: white;
}

.btn-cancel:hover {
    background: #4b5563;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .input-group {
        flex-direction: column;
        gap: 10px;
    }
    
    #taskInput {
        width: 100%;
    }
    
    .btn-primary {
        width: 100%;
        justify-content: center;
    }
    
    .filter-buttons {
        justify-content: center;
    }
    
    .task-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .task-checkbox {
        align-self: flex-start;
    }
    
    .task-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .stats-container {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .add-task-section, .filter-section, .tasks-section, .stats-section {
        padding: 20px 15px;
    }
    
    .filter-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}

/* アニメーション */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.task-item {
    animation: slideIn 0.3s ease-out;
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

.task-item.removing {
    animation: fadeOut 0.3s ease-out forwards;
}

/* ナビゲーションバー */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-brand {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.nav-brand i {
    margin-right: 10px;
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    gap: 10px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-weight: 500;
    gap: 8px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateY(-2px);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.nav-link i {
    font-size: 1.1rem;
}

/* body要素の調整 */
body {
    padding-top: 0; /* ナビバー分の余白は不要 */
}

.container {
    padding-top: 20px; /* 代わりにコンテナに余白を追加 */
}